Learn R Programming

quickerstats (version 0.0.1)

get_county_item_count: Get the count of values that exist for the specified query for county-level data.

Description

This is used as a utility function by other functions, but can also be used to explore expected results before pulling real data.

Usage

get_county_item_count(
  key,
  year,
  data_item,
  fips = "all",
  domain = "TOTAL",
  source = "CENSUS"
)

Arguments

key

Your NASS API key.

year

Must be a census year (e.g. 2012, 2017).

data_item

The long description of the desired series. Use search_data_items function to find one.

fips

Must be 'all', a 2-digit state fips, or a 5-digit county fips.

domain

A modifier on data_item, some characterstic (e.g. size categories of operations), use 'all' to get all.

source

Must be 'CENSUS' or 'SURVEY'.

Value

The count of values.

Examples

Run this code
# NOT RUN {
key <- Sys.getenv('NASS_KEY')
get_county_item_count(key=key, year=2017,
                      data_item='CORN, GRAIN - ACRES HARVESTED', fips='all')
get_county_item_count(key=key, year=2017,
                      data_item='CORN, GRAIN - ACRES HARVESTED', fips='08')
get_county_item_count(key=key, year=2017,
                      data_item='CORN, GRAIN - ACRES HARVESTED',
                      fips='08069', domain='all')
# }

Run the code above in your browser using DataLab