项目作者: emraher

项目描述 :
Interface to United States Department of Agriculture (USDA) National Agricultural Statistics Service (NASS) Database
高级语言: R
项目地址: git://github.com/emraher/rnass.git
创建时间: 2015-10-21T06:35:26Z
项目社区:https://github.com/emraher/rnass

开源协议:

下载


rnass

Build Status

Interface to USDA NASS QuickStats

WARNING

This is my first attempt for an R package. I heavily benefited from ropensci/rusda and ropensci/rnoaa.

Description

From USDA/NASS:

“The National Agricultural Statistics Service (NASS) offers Quick Stats, an on-line database containing official published aggregate estimates related to U.S. agricultural production. NASS develops these estimates from data collected through:

  1. 1) hundreds of sample surveys conducted each year covering virtually every aspect of U.S. agriculture
  2. 2) the Census of Agriculture conducted every five years providing state- and county-level aggregates

The Quick Stats application programming interface (API) provides direct access to the statistical information in the Quick Stats database. We invite developers to use this API and to give us feedback so we can continue to improve it.”

rnass is an attempt to an interface to Quick Stats. Note that in order to use this package you will need an API key. Request your key from here.

Get rnass

```{r eval=FALSE}
install.packages(“devtools”)
devtools::install_github(“emraher/rnass”)

  1. And load `rnass`
  2. ```{r}
  3. library("rnass")

Example 1

Get count

  1. count <- nass_count(source_desc = "SURVEY", token = "YOUR API KEY")
  2. count <- nass_count(source_desc = "SURVEY", year = "1990", token = "YOUR API KEY")

Example 2

Get parameters

  1. parameters <- nass_param(param = "source_desc", token = "YOUR API KEY")
  2. parameters <- nass_param(param = "region_desc", token = "YOUR API KEY")

Example 3

Get data

  1. data <- nass_data(source_desc = "SURVEY", sector_desc = "CROPS", commodity_desc = "CORN", state_name = "KANSAS", year = "2014", token ="YOUR API KEY" )