getDaily {icardaFIGSr} | R Documentation |
Extracting Daily Climatic Variables
Description
this function extracts daily values of climatic variables from ICARDA Data, it returns a list or data frame based on specified climatic variables. Each variable will have 365 values for each day of the calendar year.
Usage
getDaily(sites, var, cv = FALSE)
Arguments
sites |
character. Names of sites from which to extract data. |
var |
character. Climatic variable(s) to be extracted. |
cv |
boolean. If |
Details
ICARDA data has to be accessible either from a local directory on the computer or from an online repository. getDaily
will extract the climatic variables specified in var
for the sites specified in sites
.
For daily data, the function extracts average daily values starting from the first day of the calendar year, i.e. January 1, until the last day of the calendar year, i.e. December 31. Thus, 365 columns with daily values are created for each variable.
Value
An object with specified climatic variables for names in sites
.
If cv = TRUE
, the object is a list containing two data frames: the first one with average daily values of climatic variables, and the second one with daily coefficient of variation for each climatic variable.
If cv = FALSE
, the object is a data frame with average daily values of climatic variables.
Author(s)
Zakaria Kehel, Bancy Ngatia
See Also
Examples
if(interactive()){
# Extract daily data for durum wheat
durum <- getAccessions(crop = 'Durum wheat', coor = TRUE)
daily <- getDaily(sites = levels(as.factor(durum$SiteCode)),
var = c('tavg', 'prec', 'rh'), cv = TRUE)
# Get data frame with coefficient of variation from list object
# returned (when cv = TRUE)
daily.cv <- daily[[2]]
}