Learn R Programming

foreSIGHT (version 1.0.0)

calculateAttributes: Calculates the attributes of the hydroclimate time series

Description

calculateAttributes calculates the specified attributes of the input daily hydroclimate time series.

Usage

calculateAttributes(climateData, attSel, startYr = NULL, endYr = NULL)

Value

The function returns a vector of length equal to the number of selected attributes (attSel), named using the names of the attributes.

Arguments

climateData

data.frame; daily climate data, the attributes of which are to be calculated. climateData should be a data.frame with columns named year month day *variable_name1* *variable_name2*. Use viewModels() to view the valid variable names. Note that the first three columns of the data.frame contain the year, month, and day of the data. The columns have to be named as specified. Please refer data provided with the package that may be loaded using data(tankDat) for an example of the expected format of climateData.

attSel

a vector; specifying the names of the attributes to be calculated.

startYr

a number (default NULL); to specify the starting year to subset climateData if required. If NULL, startYr is starting year in the input climateData.

endYr

a number (default NULL); to specify the ending year to subset climateData if required. If NULL, endYr is last year in the input climateData.

See Also

viewAttributes, viewAttributeDef

Examples

Run this code
# view the names of available attributes
viewAttributes()
# load example climate data available in the package
data("tankDat")
attSel <- c("P_ann_tot_m", "P_ann_nWet_m", "P_ann_R10_m", "Temp_ann_rng_m", "Temp_ann_avg_m")
tank_obs_atts <- calculateAttributes(tank_obs, attSel = attSel)

Run the code above in your browser using DataLab