byIndv4Intvl_WaterUse: Calculates, water use traits (WU, WUR, WUI) over a specified...

byIndv4Intvl_WaterUseR Documentation

Calculates, water use traits (WU, WUR, WUI) over a specified time interval for each individual in a data.frame in long format.

Description

Calculates one or more of water use (WU), water use rate (WUR), and, for a set of responses, water use indices (WUI)s over a specified time interval for each individual in a data.frame in long format.

Usage

byIndv4Intvl_WaterUse(data, water.use = "Water.Use", responses = NULL, 
                      individuals = "Snapshot.ID.Tag", times = "DAP", 
                      trait.types = c("WU", "WUR", "WUI"), 
                      suffix.rate = "R", suffix.index = "I", 
                      sep.water.traits = "", sep.responses = ".", 
                      start.time, end.time, 
                      suffix.interval = NULL, sep.suffix.interval = ".", 
                      na.rm = FALSE)

Arguments

data

A data.frame containing the column from which the water use traits are to be calculated.

water.use

A character giving the names of the column in data that contains the water use values.

responses

A character giving the names of the columns in data for which WUIs are to be calculated.

individuals

A character giving the name of the factor that defines the subsets of the data for which each subset corresponds to the response values for an individual (e.g. plant, pot, cart, plot or unit).

times

A character giving the name of the column in data containing the times at which the data was collected, either as a numeric, factor, or character. It will be used identifying the intervals and, if a factor or character, the values should be numerics stored as characters.

trait.types

A character listing the trait types to compute and return. It should be some combination of WU, WUR and WUI, or be all. See Details for how each is calculated.

suffix.rate

A character giving the label to be appended to the value of water.use to form the name of the WUR.

suffix.index

A character giving the label to be appended to the value of water.use to form the name of the WUI.

sep.water.traits

A character giving the character(s) to be used to separate the suffix.rate and suffix.index values from the responses values in constructing the name for a new rate/index. The default of "" results in no separator.

sep.responses

A character giving the character(s) to be used to separate the suffix.rate value from aresponses value in constructing the name for a new index. For no separator, set to "".

start.time

A numeric giving the times, in terms of values in times, that will give a single value for each Snapshot.ID.Tag and that will be taken as the observation at the start of the interval for which the WUI is to be calculated.

end.time

A numeric giving the times, in terms of values times, that will give a single value for each Snapshot.ID.Tag and that will be taken as the observation at the end of the interval for which the WUI is to be calculated.

suffix.interval

A character giving the suffix to be appended to the names of the columns for the water use traits to indicate the interval for which the traits have been calculated .

sep.suffix.interval

A character giving the separator to use in appending suffix.inteval to a growth rate. For no separator, set to "".

na.rm

A logical indicating whether NA values should be stripped before the calculation proceeds.

Details

WU

is the water use and is the sum of the water use after start.time until end.time. Thus, the water use up to start.time is not included.

WUR

is the Water Use Rate and is WU divided by the difference between end.time and start.time.

WUI

is the Water Use Index and is calculated as a response difference between the start.time and the end.time, which s then divided by the WU.

Value

A data.frame containing the individuals column, WU and/or WUR and, if requested, a WUI for each element of responses. The names of WU and WUR will have suffix.interval appended, if it is not NULL, separated by a full stop (‘.’). The name of each WUI will be the concatenation of an element of responses with WUI and, if not NULL, suffix.interval, the three components being separated by a full stop (‘.’).

Author(s)

Chris Brien

See Also

byIndv4Intvl_GRsAvg, byIndv4Intvl_GRsDiff, splitValueCalculate, getTimesSubset,
GrowthRates

Examples

data(exampleData)
WU.WUI_31_35 <- byIndv4Intvl_WaterUse(data = longi.dat, 
                                      water.use = "WU", responses = "PSA", 
                                      times = "DAP", 
                                      trait.types = c("WUR","WUI"), 
                                      suffix.rate = ".Rate", 
                                      suffix.index = ".Index",
                                      start.time = 31, end.time = 35, 
                                      suffix.interval = "31to35")

growthPheno documentation built on Oct. 24, 2023, 5:08 p.m.