get_param_values: Get all values a parameter can take.

Description Usage Arguments Value Examples

View source: R/nass_api.R

Description

Get all values of a parameters that can be passed in a GET request. Primarily used as a utility function by other functions. See https://quickstats.nass.usda.gov/api for a table of parameter names.

Usage

1
2
3
4
5
6
7
8
get_param_values(
  key,
  param,
  short_desc = NA,
  source_desc = NA,
  year = NA,
  agg_level_desc = NA
)

Arguments

key

Your NASS api key.

param

The parameter name to get values of.

short_desc

The short_desc for which to get possible values of the param.

source_desc

The source_desc for which to get possible values of the param.

year

The year for which to get possible values of param.

agg_level_desc

The agg_level_desc for which to get possible values of param.

Value

A vector of all values that the parameter can take.

Examples

1
2
3
4
5
key <- Sys.getenv('NASS_KEY')
get_param_values(key=key, param='short_desc')
get_param_values(key=key, param='year',
                 short_desc='CORN, GRAIN - ACRES HARVESTED',
                 source_desc='CENSUS')

quickerstats documentation built on Oct. 23, 2020, 8:11 p.m.