read.census: Read raw data from the Census Bureau using the API

Description Usage Arguments Value Examples

Description

Get raw data from the Census Bureau, JSON format is converted to R data frame

Usage

1

Arguments

url

character vector of length one containing the get query.

Value

data frame

Examples

1
2
3
4
5
6
# State populations based on the 2010 Decennial Census
popstate <- read.census(sprintf("http://api.census.gov/data/2010/sf1?key=%s&get=P0010001,NAME&for=state:*", getkey()))

#  get data on total population for all congressional districts of iowa
u1 <- sprintf("http://api.census.gov/data/2011/acs1_cd113?key=%s&get=DP02_0086E&for=congressional+district:*&in=state:19", getkey())
df2 <- read.census(u1)

heike/cbapi documentation built on May 17, 2019, 3:23 p.m.