getOnset {icardaFIGSr}R Documentation

Extracting Daily Climatic Variables Based on Onset of Planting

Description

this function Extracts Daily values of climatic variables from remote ICARDA data based on Onset of Planting, it returns a list based on specified climatic variables. Each variable will have 365 values for each day of the (onset) year beginning with planting day.

Usage

getOnset(sites, crop, var, cv = FALSE)

Arguments

sites

character. Names of sites from which to extract data.

crop

character. Crop code in ICARDA database. See section 'Details' for a list of crops.

var

character. Climatic variable(s) to be extracted.

cv

boolean. If TRUE, returns a data frame with coefficient of variation for each variable for each day of the onset year. Default: FALSE.

Details

Similar to getDaily except the extracted data is based on 365 days starting from the onset of planting. Crops available in ICARDA's genebank documentation system include the following:

Alternatively, the list of available crops can be fetched from ICARDA's online server using getCrops.

Value

An object of class "data.frame" with specified climatic variables for names in sites.

If cv = TRUE, the object is a list containing three data frames: the first one with average daily values of climatic variables, the second one with daily coefficient of variation for each climatic variable, and the third one with phenotypic variables and number of day in calendar year when each occurs at the sites specified in sites.

If cv = FALSE, the object is a list containing two data frames: the first one with average daily values of climatic variables, and the second one with phenotypic variables and number of day in calendar year when each occurs at the sites specified in sites.

Author(s)

Khadija Aouzal, Amal Ibnelhobyb, Zakaria Kehel, Bancy Ngatia

See Also

dcast, getCrops

Examples

if(interactive()){
 # Extract onset data for durum wheat
 durum <- getAccessions(crop = 'Durum wheat', coor = TRUE)
 onset <- getOnset(sites = levels(as.factor(durum$SiteCode)), crop = 'ICDW',
                   var = c('tavg', 'prec', 'rh'), cv = TRUE)

 # Get data frame with climatic variables from list object returned
 onset.clim <- onset[[1]]

 # Get data frame with coefficient of variation from list object
 # returned (when cv = TRUE)
 onset.cv <- onset[[2]]

 # Get data frame with phenotypic variables from list object returned
 onset.pheno <- onset[[3]]
 }

[Package icardaFIGSr version 1.0.2 Index]