hrecht / censusapi

R package to retrieve U.S. Census data and metadata via API
https://www.hrecht.com/censusapi/
169 stars 31 forks source link

Add examples in help files for finer-scale data (e.g., block) #7

Closed mtreg closed 7 years ago

mtreg commented 7 years ago

This is a great package - thanks for your great work on it!

Particularly for folks new to the US Census API it would be helpful to have some more examples - in particular, for getting data at as fine as tract or block level. I've included an example below for Census block in case you'd like to include, and could also issue pull request if you prefer - just let me know.

data2010 <- getCensus(name="sf1", 
vintage=2010,
key=censuskey, 
vars=c('PLACE','P0010001', 'P0030001', 'BLKGRP'), 
region="block:*", regionin='state:36+county:27')
hrecht commented 7 years ago

Thanks, a pull request would be great!

mtreg commented 7 years ago

Just following-up on this - submitted a pull request with updates to README and the getcensus_functions.R file (formatted appropriately for ROxygen2)

hrecht commented 7 years ago

Thanks @mtreg, sorry for the slow response. I haven't had a chance to review and run tests yet but as soon as I can turn back to the package I will. Looks good on Github.

hrecht commented 7 years ago

Addressed in https://github.com/hrecht/censusapi/pull/8 and https://github.com/hrecht/censusapi/commit/164d07d04a9823deebfcb1636d949a70c6cccbdb