-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hello,
I've noticed that when using getQuickStats() from this package, the Value column returns NA regardless whether the value is redacted (D) or Not Available (NA). I'm curious about how these values are being handled internally.
Issue
- Redacted values such as
(D)( to avoid disclosing individual operations) andNA(Not Available) are automatically converted toNA - This makes it difficult to distinguish between truly missing data and intentionally redacted data in downstream analysis.
Questions
- Does
getQuickStats()parse the API response and convert Values with non-numeric values toNA, regardless of whether it's(D)orNA? - Is there a way (or could there be an option) to preserve the original USDA suppression code in the
Valuecolumn, e.g. keep(D)orNAas character values instead of coercing them toNA?
Preserving this information would be useful for analysis that accounts for estimating animal counts
Code Example:
dairycows <- getQuickstat(key = NASS_API_KEY, program = "CENSUS", data_item = "CATTLE, COWS, MILK - INVENTORY", sector = "ANIMALS & PRODUCTS", domain = "TOTAL", geographic_level = "COUNTY", state = NULL, year = <YEAR_HEEE>, geometry = FALSE, lower48 = F # weighted_by_area = FALSE )
Example result:
The image on the left is our Exported Data and on the right is the download data from https://quickstats.nass.usda.gov/

The highlighted rows are the exact match for both dataset. The downloaded data from usda.gov returns (D) or redacted as oppose to the data generate by getQuickStats()
Thank you so much!