This repository contains an R script (peanuts.R) for downloading, analyzing, and vizualizing days suitable for fieldwork (DSFW) in 11 peanut producing states. This script connects directly to source USDA-NASS Quickstats databases via API connection and requires no local data files. Successfully running this script requires an API key from USDA-NASS, further instructions below.
R version 3.4.2 was used at time of development.
There are two version of the R Script. The peanutsDSFW_2019.R was created in response to a change in the USDA-NASS Quickstats API and to add in additional data that was made available over time from the public data source since publishing the original code.
Click the link below and follow steps to request USDA-NASS Quickstats API key. Enter the key in the R script where indicated.
https://quickstats.nass.usda.gov/api
Figures generated by the R Script for each of the 11 peanut producing states are found in the Figures folder. Each state has five figures numbered 1-5 identified by what the plot contains and the state name.
Figure 1 is weekly plot of DSFW by probability distribution at 15%, 50%, and 85%. The probabilites reflect the likelihood of having at least that many days of field work availale each week (Ex: 1DSFWNorth Carolina).
Figure 2 is the weekly progress in completing planting and harvesting field operation. Between 15% and 85% complete is considered "most active" for field work (Ex: 2progressNorth Carolina).
Figure 3 is a histogram of the historical number of DSFW available for planting field work (Ex: 3histNorth CarolinaPlanting).
Figure 4 is a histogram of the historical number of DSFW available for harvesting field work (Ex: 4histNorth CarolinaHarvest).
Figure 5 is plot of trend in is total DSFW over time (Ex: 5trendNorth Carolina).
This script was authored by Terry Griffin and his team at Kansas State University (Meet Terry) and was used to develop a publication co-authored by Jason Ward at NC State University (Meet Jason).
The goal is to create R Markdown to associate with this script. Please check back.