Agricultural Economics Department
Date of this Version
6-23-2020
Document Type
News Article
Citation
Farm and Ranch management News (June 23, 2020).
Also available at https://farm.unl.edu/introduction-r-package-usdampr.
DOI: 10.13014/frm00016.
Abstract
Why the Need for the Package? In the 1990’s, concern over growing packer concentration and a hog industry market shock resulted in discontent among producers and packers. As a result, the United States Congress passed the Livestock Mandatory Reporting Act of 1999 (1999 Act) [Pub. L. 106-78, Title IX] which is required to be reauthorized every five years. See here for a full history of the Livestock Mandatory Reporting Background.
Market reports were publicly issued in the form of .txt files with varying frequency from April 2000 to April 2020. Current and historical data were also housed in a USDA-AMS database that could also be accessed through the https://mpr.datamart.ams.usda.gov/ website. In an effort to make data more accessible the USDA-AMS began to develop APIs that could interface directly with this database. However, starting in April 2020, text files were made permanently unavailable leaving direct access at https://mpr.datamart.ams.usda.gov/ or API access the only plausible methods to access the data.
The R programming language is a free software used for statistical computing and graphics that is widely used among statisticians and data analysts in industry academics, and government. It allows users to create packages/libraries that can be downloaded and distributed for free. Using the API documentation provided by USDA-AMS (see here for detailed API documentation), we developed an R package entitled ‘usdampr’ whose functions directly access the USDA-AMS databases. Its primary purpose is to allow greater public access to USDA-AMS data for those not familiar or comfortable directly accessing the data via API and is a viable alternative to now extinct text files and direct downloads from https://mpr.ams.usda.gov.
Summary
This document has introduced the R package ‘usdampr’ which allows users to access the USDA-AMS mandatory price reporting database. It has documented the need for the package, relevant examples for accessing LMPR, DPMPR, and FMMOS data requiring only slug id’s and date range, and how the data can be displayed. Questions regarding package development or bugs can be directed to Elliott J. Dennis.
Included in
Agribusiness Commons, Agriculture Commons, Bioinformatics Commons, Databases and Information Systems Commons, Entrepreneurial and Small Business Operations Commons, Management Information Systems Commons, Other Business Commons, Other Economics Commons
Comments
Copyright 2020, the authors. Used by permission.