CRAN_Status_BadgeTravis-CI Build Status AppVeyor Build Status metacran downloads

Retrieve, Summarize and Visualize the Fertilizer Data in USA

Provides a user-friendly API to further dig in County-Level Fertilizer data in USA, provided by USGS.

Installation

This package can be installed via github using devtools.

Quick Start

Summarize and plot data.

Example 1: Find out the top 10 counties with most nitrogen appliation in 2008.

# plot the top 10 nitrogen application in year 2008.
plot <- plot_data %>% 
  top_n(10, Quantity) %>%
  ggplot(aes(x=reorder(County, Quantity), Quantity, fill = Quantity))+
  scale_fill_gradient(low = "blue", high = "darkblue")+
  geom_col()+
  ggtitle(paste("Top 10 counties with most N fertilizer application in the year of", Year)) + 
  scale_y_continuous(name = "Nitrogen from commecial fertilization (kg)")+
  scale_x_discrete(name = "Counties")+
  coord_flip()+
  theme_bw()
plot

Examples 2: Visualize the fertilizer data in US maps.

As the maps are actually ggplot2 objects, all the common API for ggplot2 can be used here. We can also add a title for the map to make it more informative.

us_plot +
  ggtitle(paste(Nutrient,  " from ", Input_Type, " input to ", Farm_Type, " in the year of ",Year,
                     " at ", level, " level",sep = ""))

For more details about mapping fertilizer data, please see this vignettes of plotting us maps of fertilizer.

Example 3: Visualize the fertilizer data for certain states or counties.

For more details about mapping fertilizer data, please see this vignettes of plotting state maps

Generate summaries plots.

(Under development on July 10, 2018)

Comments and Questions

If you have any problems or questions, feel free to open an issue here.

Lisence

GPL

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.