Professional Documents
Culture Documents
CTV Agricultural Sciences
CTV Agricultural Sciences
html
Note that some of these packages are on CRAN and others are on GitHub, Bioconductor,
or R-Forge.
If you think that a package is missing from this list, please let us know through issues or
pull requests in the GitHub repository.
Table of contents
1 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• USDA databases: Data from the United States Department of Agriculture’s National
Agricultural Statistical Service ‘Quick Stats’ web API can be accessed with rnassqs
or with tidyUSDA, which also offers some mapping capabilities. The USDA’s
Cropland Data Layer API can be accessed with CropScapeR and cdlTools, the latter
providing utility functions for processing CDL data. rusda provides an interface to
access the USDA-ARS Systematic Mycology and Microbiology Laboratory
(SMML)’s four databases: Fungus-Host Distributions, Specimens, Literature and the
Nomenclature database. The USDA’s Agricultural Resource Management Survey
(ARMS) data API can be accessed with rarms. The USDA’s Livestock Mandatory
Reporting data API can be accessed with usdampr. The packages FAOSTAT and
faobulk can be used to access data from the FAOSTAT Database from the United
Nations Food and Agricultural Organization (FAO).
• Most USDA-NRCS soils related databases and APIs can be accessed with soilDB.
• FedData provides access to geospatial data from the United States Soil Survey
Geographic (SSURGO) database, the Global Historical Climatology Network
(GHCN), the Daymet gridded estimates of daily weather parameters for North
America, the International Tree Ring Data Bank, and the National Land Cover
Database. SSURGO data can also be accessed and processed with XPolaris.
• NASA soil moisture active-passive (SMAP) data can be accessed and processed with
smapr (archived).
• SILO weather data from the Queensland DES Longpaddock website can be accessed
with cropgrowdays.
2 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• pestr offers tools to extract pest data from EPPO Data Services and EPPO Global
Database using EPPO database API and put them into tables with human-readable
formats.
Many of the agriculture-focused packages listed in this guide also include data sets to
illustrate their functionality (e.g. agricolae, AgroTech, BGLR).
• agridat consists of a very large collection of agricultural data sets and example
analyses; the package contains a vignette detailing additional data sets and extensive
resources to support agricultural analysis.
• The soybean nested associated mapping population data set can be accessed via
SoyNAM.
• The FAOSTAT data set collection for the Food and Agriculture Biomass Input–
Output model (FABIO) is available through fabio.
• ZeBook provides data sets and examples accompanying the book Working with
Dynamic Crop Models.
The MixedModels task view provides a comprehensive list of packages relevant to fitting
general and generalized linear mixed models.
• The packages nlraa and AgroReg provides linear and nonlinear regression functions
specifically for agricultural applications. biotools can conduct a wide array of
multivariate analysis for agronomists including genetic covariance, optimal plot size,
tests for spatial dependence, and tests for seed lot heterogeneity.
3 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• agriCensData is a flexible package for working with censored data (e.g. time to
flowering, instrumentation values below the detection limit, disease scoring).
• ALUES implements methodology developed by the FAO and the International Rice
Research Institute for evaluating land suitability for different crop production.
Discipline-specific packages
Agricultural economics
The task views for Econometrics, (Empirical) Finance, and TimeSeries provide
information on packages and tools relevant to agriculture economics.
• Agricultural price forecasting: vmdTDNN forecasts univariate time series data using
variational mode decomposition based time delay neural network models as
described by Dragomiretskiy 2014. stlELM also conducts univariate time series
forecasting univariate time series, using seasonal-trend decomposition procedures
based on loess (STL) combined with the extreme learning machine developed by
Xiong 2018. The package eemdTDNN also conduct univariate forecasting, utilizing
different decomposition based time delay neural network models based on Yu 2008.
Agrometeorology
The Hydrology has many resources for accessing and processing weather and climate data.
• Data sources: Data from the Copernicus data set of agrometeorological indicators
can be downloaded and extracted using ag5Tools. Climate crop zones in Brazil can
be accessed and calculated with cropZoning using data sets from TerraClimate that
are calibrated to weather stations run by the National Meteorological Institute of
Brazil. acdcR (AgroClimatic Data by County) provides functions to calculate United
States county-level variables in agricultural production or agroclimatic and weather
analyses.
• Data preparation: meteor provides a set of functions for weather and climate data
manipulation to support crop and crop disease modeling. cropgrowdays and
climatrends can be used for calculating growing degree days, cumulative rainfall,
4 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
number of stress day, mean radiation, crop sensitive indices, evapotranspiration and
other variables. agroclim and weaana have many utility functions to compute
agroclimatic indices useful to zoning areas based on climatic variables and to
evaluate the importance of temperature and precipitation for individual crops or in
general for agricultural lands.
• The frost package contains a compilation of empirical methods used by farmers and
agronomic engineers to predict the minimum temperature to detect a frost event.
• kgc identifies the Koeppen-Geiger climatic zone for a given location based on
relative heat and humidity.
Agronomic trials
Experimental design
• agricolae provides extensive resources for the planning and analysis of planned field
experiments. Designs constructed by agricolae can be visualised with agricolaeplotr.
Agricultural field trials layout can be also be visualised with desplot.
• PBIBD can construct partially balanced incomplete block designs and the Youden-m
square (row-column) design and can calculate design efficiency.
• biometryassist can be used for experimental design and analysis; it also includes
several function to interface with asreml objects.
• The package DiGGer was developed for rectangular field trials; its purpose is to help
users determine the optimal experimental design based on the treatment structure and
number of replicates.
• inti provides functionality for experimental design and manipulation and it is focused
on FieldBook compatibility.
5 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• statgenHTP is for analyzing data from HTP platform experiments, with some
functions specifically designed to work with the proprietary software R-asreml.
Trial analysis
• General analysis: The package agricolae contains functions for analyzing many
common designs in agriculture trials such as split plot, lattice, Latin square and some
additional functions such AMMI and AUDPC calculations. The proprietary software
asreml provides an R version of their mixed model software for field trial analysis
(note this is not open source and requires an annual license). CRAN also contains an
add-on package asremlPlus that provides several accessory functions to asreml.
[INLA](https://www.r-inla.org/) provides tools for Bayesian inference of latent
Gaussian models, and it contains functions for modelling spatial variation, such as
field experiments or farm locations. The gosset package provides the toolkit for a
workflow to analyse experimental agriculture data, from data synthesis to model
selection and visualisation. AgroR has general functions and a Shiny app for analysis
of common designs in agriculture: CRD, RCBD and Latin square.
• Spatial analysis: the statgenSTA has functions for single trial analysis with and
without spatial components. SpATS can be used to adjust for field spatial variation
using p-splines. A localised method of spatial adjustment for unreplicated trials,
moving grid adjustment, is implemented with mvngGrAd.
• ClimMobTools is the API Client for the ClimMob citizen science platform in R for
agronomic field trials.
Animal science
The Tracking task view has many resources for working with tracked animal data and
studying animal movement.
6 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• Many of the genetic packages described in the breeding section of this task view can
also be applied to animals. visPedigree can be used to visualise complex animal
pedigrees.
See the R package repository Bioconductor for bioinformatic tools to support the
processing of high-throughput genomic data.
• General plant breeding: st4gi and variability provides several common utility
functions for genetic improvement of crops. Also, please see the subsection on
“genotype-by-environment interactions” in this task view for packages integrating
environmental and genomic data in an analytical framework. gpbStat provides
functions for common plant breeding analyses including line-by-tester analysis
(Arunachalam 1974 and diallel analysis (Griffing 1956).
• lmDiallel provides service functions for analysing data sets obtained from diallel
experiments, as described in Onofri 2020.
• There are two notable and long-standing packages for quantitative trait loci (QTL)
analysis: (1) onemap, providing MapMaker/EXP-like performance and additional
tools; and (2) qtl providing standard QTL mapping functionality and accessory
functions for simulating crosses. BatchMap is a fork of onemap for fast computation
of high density linkage maps. ASMap can conduct fast linkage mapping with the
algorithm ‘MSTmap’. pergola implements the PERGOLA algorithm for ordering
markers in a linkage group. MapRtools is multipurpose linkage mapping package for
teaching and research.
• For polyploids, the packages mappoly and polymapR can be used for linkage
mapping and the packages qtlpoly and polyqtlR can be used for QTL estimation.
diaQTL is for QTL and haplotype analysis of diallel populations (diploid and
autotetraploid).
7 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
There are many GWAS packages on Bioconductor and a large number of other GWAS
packages in CRAN not listed here. The packages listed here have specific applications in
breeding populations common in agriculture.
• GWAS can be conducted using a stepwise mixed linear model for multilocus data
with mlmm.gwas or MultLocMixMod (use library(mlmm) to load the package in R).
The package statgenGWAS can fit GWAS models using the EMMAX algorithm.
GAPIT3 is wrapper for several GWAS algorithms including the original GAPIT,
FarmCPU and BLINK.
• GWAS models for a very large number of SNPs and/or observations can be
estimated with rMVP. GridLMM provides functions to conduct GWAS in models
that require two or more random effects (e.g. additive and dominance kinship
matrices, or kinship and spatial covariance matrices). Functions for conducting
GWAS in autotetraploids are provided by GWASpoly, and these functions also work
in diploid species. Variable selection for ultra-large dimensional GWAS data sets can
be done with bravo, which implements the Bayesian algorithm SVEN, selection of
variables with embedded screening.
• StageWise provides functions to conduct a 2-stage GWAS when the phenotypic data
are from multiple field trials.
Genomic prediction
8 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• pedmod provides linear modelling functions integrating kinship for categorical traits.
• coxme can fit Cox proportional hazards models containing both fixed and random
effects with a kinship matrix.
• TSDFGS can estimate the optimal training population size and composition for
genomic selection.
• PopVar has function for estimating population genetic variance from a biparental
cross.
• The apsimx package has functions to read, inspect, edit and run files for APSIM
“Next Generation” (.json, .apsimx) and APSIM “Classic” (.xml, .apsim) files.
rapsimng works with next generation APSIM files.
9 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• Crop Water Usage: cropDemand can be used to estimate crop water demand in
Brazilian production regions using the TerraClimate data set. Evapotranspiration can
estimate potential and actual evapotranspiration using 21 different models.
• metrica has many convenience functions for comparing model predictions with
ground truth data.
Entomology
• The Survival task view lists resources for working with censored data. The package
agriCensData provides functions for dealing with censored data in common
agricultural contexts.
• hnp Generates half-normal plots with simulation envelopes using different
diagnostics from a range of different fitted models.
Food science
For packages supporting sensory studies, see the Psychometrics task view.
Genotype-by-environment interactions
10 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
• The package gge can generate GGE biplots, while bayesammi can conduct Bayesian
estimation of additive main effects multiplicative interaction (AMMI) model. metan
and geneticae can performs stability analysis of multi-environment trial data using a
wide range of parametric and non-parametric methods.
• EnvRtype can be used for assembling climate data, data set preparation and
environmental classification or envirotyping.
• A wide variety of stability analysis statistics can be calculated via agrostab including
coefficient of homeostaticity, specific adaptive ability, weighted homeostaticity
index, superiority measure, regression on environmental index, Tai’s stability
parameters, stability variance, ecovalence and other stability parameters.
toolStability and stability also calculate stability analyses.
Plant pathology
The Epidemiology task view lists relevant package for modelling plant diseases.
• epifitter provides functions for analysis and visualization of plant disease progress
curve data.
• Plant Pathogen Genetics: hagis has functions for analysis of plant pathogen
pathotype survey data. Functions provided calculate distribution of susceptibilities,
distribution of complexities with statistics, pathotype frequency distribution, as well
as diversity indices for pathotypes. Evolution of resistance genes under pesticide
pressure can be simulated under different numbers of pests, modes of pest
reproduction, resistance loci, number of pesticides and other facets with resevol.
Populations with mixed clonal/sexual reproductive strategies can be analyzed with
poppr, which has population genetic analysis tools for hierarchical analysis of
partially clonal populations.
Rural sociology
11 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
See the task view for Psychometrics for general sociology packages.
• Both the Survival task view and the agriCensData package provide tools for working
with interval and censored data.
• Spatial: The Spatial and SpatioTemporal CRAN task views provide extensive
resources in spatial statistics. mpspline2 implements a mass-preserving spline to soil
attributes to make continuous down-profile estimates of attributes measured over
discrete, often discontinuous depth intervals.
• For soil pedology, aqp provides a general toolkit for soil scientists: specialized data
structures, soil profile summary, visualisation, color conversion, and more.
SoilTaxonomy provides functions for parsing soil taxonomic terms. pedometrics has
many utility functions for common analyses of soil data.
• Soil water: Soil water retention curves can be calculated by the soilwater packages
using the Van Genuchten (1980) method for soil water retention and Mualem (1976)
method for hydraulic conductivity. Estimation and prediction of parameters of soil
hydraulic property models can be accomplished with spsh.
• SoilR models soil organic matter decomposition in terrestrial ecosystems with linear
and nonlinear models. The sorcering can be used to model soil organic carbon and
soil organic nitrogen and to calculate N mineralisation rates.
• Soil texture triangles can be graphed using soiltexture; this package can also classify
and transform soil texture data.
• OBIC calculate the Open Bodem Index, a method to evaluate the quality of soils of
agricultural fields in The Netherlands and the sustainability of the current
agricultural practices.
• Soil Fertility Testing: soiltestcorr has functions for conducting correlation analysis
between soil test values and crop yield data. SoilTesting provides functions for
calculating soil mineral concentrations from analytical lab results. fertplan provides
fertilizer recommendations based on soil test results (note this package is optimized
for horticultural crop production in Italy).
• The suitability of specific soils for crop production can be analyzed using
soilassessment, including soil fertility classes, soil erosion models and soil salinity
classification. Suitability requirements are for crops grouped into cereal crops, nuts,
12 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
Remote sensing
• spectralR can be used to access and process Sentinel 2 Level 2A satellite mission
optical bands pixel data, obtained from the Google Earth Engine. rsat and satellite
can be used to process remote sensing data.
• Agriculture image features from spectral data can extracted with agrifeature. It has
functions to calculate gray level co-occurrence matrix (GLCM), RGB-based
vegetative index (RGB VI) and normalized difference vegetation index (NDVI).
• Experimental units (e.g. plots) can be obtained from spectral images using rPAex. lue
implements the light Use efficiency Model to estimate biomass and yield. Leaf area
index and soil moisture from microwave backscattering data based on the WCM
model can be calculated with the WCM package.
• The mapsRinteractive package provides functions for working with soil point data in
raster format.
Weed science
For ecological studies and analytical applications, the Environmetrics task view provides a
list of existing R resources in this topic.
• Dose Response: the package drc offers versatile model fitting and after-fitting
functions for dose-response curves. LW1949 implements the Litchefield and
Wilcoxon (1949) dose-response model.
CRAN packages
Core: AGHmatrix, agricolae, agridat, apsimx, aqp, cdlTools, drc, DSSAT, FedData,
inti, meteor, nlraa, qtl, sommer, tidyUSDA.
Regular: acdcR, ag5Tools, AGPRIS, agricolaeplotr, agrifeature, agriTutorial, agriwater,
AgroR, AgroReg, agrostab, AgroTech, AlphaSimR, ALUES, AquaBEHER,
ascotraceR, ASMap, asremlPlus, bayesammi, BGGE, BGLR, bigleaf,
biometryassist, biotools, bravo, BWGS, climatrends, ClimMobTools, coxme,
cropdatape, cropDemand, cropgrowdays, CropScapeR, cropZoning, Dasst,
desplot, DMMF, drcte, eemdTDNN, epifitter, Evapotranspiration, FAO56,
FAOSTAT, FielDHub, fruclimadapt, FWRGB, geneticae, gge, gosset, gpbStat,
grapesAgri1, GSelection, GSMX, hagis, heritability, hnp, IBCF.MTME, ispd,
KenSyn, kgc, kinship2, landsepi, LinkageMapView, lmDiallel, lue, LW1949,
LWFBrook90R, mappoly, mapsRinteractive, metan, MeTo, metrica,
mlmm.gwas, MoBPS, mpspline2, mvngGrAd, NutrienTrackeR, OBIC, onemap,
13 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
Related links
Other resources
14 of 15 17/02/2024, 17:20
CRAN Task View: Agricultural Science https://cran.r-project.org/web/views/Agriculture.html
15 of 15 17/02/2024, 17:20