getDaily: Extracting Daily Climatic Variables

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/getDaily.R

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

1
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 TRUE, returns a data frame with coefficient of variation for each variable for each day of the calendar year. Default: FALSE.

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

cast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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]]
 }

khadijaaziz/icardaFIGSr documentation built on Dec. 21, 2021, 6:38 a.m.