Exporting data from UScensus2010

别等时光非礼了梦想. 提交于 2019-12-12 01:42:32

问题


I need to extract Census 2010 data for CDPs (nationwide) and figured it would be simplest to use the UScensus2010 package to extract the key tables I need, one state at a time, and then export the resulting data. Towards this end I ran the following code

 library(UScensus2010) 
 install.cdp("osx")
 demographics(dem="P0030001", state="oh",level="cdp")
 p3.race <- demographics(dem=c("P0010001", "P0030001", "P0030002",  "P0030003", "P0030004", "P0030005", "P0030006"), state="oh",level="cdp")

Note that for p3.race we have

  ..$ : chr [1:1204] "Hamler village" "Florida village" "Deshler village" "New Bavaria village" ...
  ..$ : chr [1:7] "P0010001" "P0030001" "P0030002" "P0030003" ...

So far so good. Now, what would be the best way to export p3.race (as *.csv *.dta, or any other format) such that the CDP names show up as column A and P001001:P0030006 show up as Columns B:H?

来源:https://stackoverflow.com/questions/15192004/exporting-data-from-uscensus2010

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!