Description Usage Arguments Details Examples
A wrapper function for the rnassqs
package, get_nassqs_data
makes a HTTP GET
request to the USDA-NASS Quick Stats API and returns a subset of the data parsed as a
tibble.
1 2 3 4 5 6 | get_nassqs_data(
comm_list = c("CORN", "COTTON", "SOYBEANS", "WHEAT", "SUGARCANE", "SUGARBEETS",
"SORGHUM", "RICE", "BARLEY"),
start_year = 1990L,
end_year = 2019L
)
|
comm_list |
A list of 'nassqs' commodities. All possible values available from |
start_year |
A start year integer |
end_year |
An end year integer |
The default comm_list includes CORN, COTTON, SOYBEANS, WHEAT, SUGARCANE, SUGARBEETS, SORGHUM, RICE, BARLEY, and APPLES
The default date range is 1990 through 2019
The core 'rnassqs' function nassqs()
is mapped with 'purrr' to be called for each combination of year and commodity. Larger data requests will require more time
1 2 3 4 5 6 7 | library(tidyverse)
comm_list <- c("CORN","WHEAT")
start_year <- 2018L
end_year <- 2019L
get_nassqs_data(comm_list, start_year, end_year)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.