state: state field - either a string or character vector with multiple states
county: county field - either a string or character vector with multiple states
year: year field - string
geometry: geometry field (TRUE or FALSE), set to TRUE if you would like a simple features (SF) geometry field included. Only works when geographic_level is set to 'COUNTY' or 'STATE'
lower48: limit data to the lower 48 states? - TRUE or FALSE
weighted_by_area: option to mutate a new column that takes the target ('Value') and divides it by the square miles in that state or county; only works when GEOMETRY = TRUE - TRUE or FALSE
Note
Go to the webpage https://quickstats.nass.usda.gov/. As a best practice, select the items in these fields and test that that data item exists in the browser before using those parameters in this function. When you have a dataset that works, enter those values in the function as parameters. Ideally, only enter values for your key obviously, then PROGRAM, DATA_ITEM, GEOGRAPHIC_LEVEL and then if necessary, DOMAIN, STATE, COUNTY or YEAR.
Examples
## Not run:getQuickstat( key ="your_key", program ="CENSUS", data_item ="CROP TOTALS - OPERATIONS WITH SALES", geographic_level ="COUNTY", domain ="TOTAL", year ="2017", state =NULL, geometry = T, lower48 = T
)## End(Not run)