if (FALSE) {
# Yields for corn in 2012 in Washington
params <- list(commodity_desc = "CORN",
year = 2012,
agg_level_desc = "STATE",
state_alpha = "WA",
statisticcat_desc = "YIELD")
# Returns a request object that must be parsed either manually or
# by using nassqs_parse()
response <- nassqs_GET(params)
yields <- nassqs_parse(response)
head(yields)
# Get the number of records that would be returned for a given request
# Equivalent to 'nassqs_record_count(params)'
response <- nassqs_GET(params, api_path = "get_counts")
records <- nassqs_parse(response)
records
# Get the list of allowable values for the parameters 'statisticcat_desc'
# Equivalent to 'nassqs_param_values("statisticcat_desc")'
req <- nassqs_GET(list(param = "statisticcat_desc"),
api_path = "get_param_values")
statisticcat_desc_values <- nassqs_parse(req, as = "list")
head(statisticcat_desc_values)
}
Run the code above in your browser using DataLab