sahie: Get SAHIE data

Description Usage Arguments Value Examples

Description

Get SAHIE data at various geographic levels.

Usage

1
2
3
4
5
6
7
sahie(geo, year = 2014, var = c("NAME", "NUI_PT"), api_key = NULL)

sahie_us(...)

sahie_state(...)

sahie_county(...)

Arguments

geo

(character) One of "us", "state", and "county".

year

(numeric) A four-digits value or vector of values. Possible values: 2006–2014.

var

(character) A string or vector of strings. Possible fields: http://api.census.gov/data/timeseries/healthins/sahie/variables.html

api_key

Use sahieAPI::set_api_key("<Your api here>") to set api_key.

...

Pass parameter year or var for function sahie_us(), sahie_state(), and sahie_county(). Also see Example section.

Value

Return a tibble, i.e., modern data frame. If multiple years are specified, it gives a panel dataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
sahieAPI::set_api_key("<Your api here>")

# Get national level uninsurance rate for various income groups in 2014
sahieAPI::sahie(geo = "us", year = 2014, var = c("NAME", "NUI_PT", "IPR_DESC", "IPRCAT", "PCTUI_PT"))

# Or
sahieAPI::sahie_us(year = 2014, var = c("NAME", "NUI_PT", "IPR_DESC", "IPRCAT", "PCTUI_PT"))

# Get 2013--2014 data for natinal level, state-level, and county-level
sahieAPI::sahie_us(year = 2013:2014, var = c("NAME", "NUI_PT", "IPR_DESC", "IPRCAT", "PCTUI_PT"))
sahieAPI::sahie_state(year = 2013:2014, var = c("NAME", "NUI_PT", "IPR_DESC", "IPRCAT", "PCTUI_PT"))
sahieAPI::sahie_county(year = 2013:2014, var = c("NAME", "NUI_PT", "IPR_DESC", "IPRCAT", "PCTUI_PT"))

## End(Not run)

jjchern/sahieAPI documentation built on May 19, 2019, 11:39 a.m.