getDBInfo: Get variable names and descriptions for data sets available...

Description Usage Arguments Value Examples

Description

Get variable names and descriptions for data sets available through Census Bureau API

Usage

1
  getDBInfo(.dbname, .year, vars = NULL, search = TRUE)

Arguments

.dbname

name of the database, one of "sf1", "acs5", "acs1_cd113", "sf1", "sf3", "sf1", "sf3". see dataset censusData for a list

.year

year of interest - cf censusData

vars

list of variables, if NULL, all are returned in the result

search

should the list of variables be interpreted as search terms?

Value

data frame with following fields:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
## need internet connection for the following code

## get meta information for the full summary file 1 file for Census 2010
census2010 <- getDBInfo("sf1", 2010)

## all available information on 'total population' from the 2011 American Community Survey
acs <- getDBInfo("acs1_cd113", 2011, "total population")
table(acs$V1.1)
head(subset(acs, depth == 2))

## get complete meta information for the 2011 American Community Survey
acs_all <- getDBInfo("acs1_cd113", 2011)
table(acs_all$depth)
table(acs_all$V1.1)  # concept variables
subset(acs_all, V1.1 == "LANGUAGE SPOKEN AT HOME")
gp <- subset(acs_all, V1.1 == "GRANDPARENTS")
table(subset(gp, depth>2)$V2)

## End(Not run)

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