byIndv4Intvl_GRsDiff: Calculates the growth rates for a specified time interval for...

byIndv4Intvl_GRsDiffR Documentation

Calculates the growth rates for a specified time interval for individuals in a data.frame in long format by differencing the values for a response within the interval.

Description

Using the values of the responses, calculates the specified combination of the Absolute Growth Rates using differences (AGR), the Proportionate Growth Rates (PGR) and Relative Growth Rates using log differences (RGR) between two nominated time points.

Usage

byIndv4Intvl_GRsDiff(data, responses, 
                     individuals = "Snapshot.ID.Tag", times = "DAP", 
                     which.rates = c("AGR","PGR","RGR"), 
                     suffices.rates=NULL, sep.rates = ".", 
                     start.time, end.time, 
                     suffix.interval, sep.suffix.interval = ".")

Arguments

data

A data.frame containing the column from which the growth rates are to be calculated.

responses

A character giving the names of the columns in data from which the growth rates 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 in calculating growth rates and, if a factor or character, the values should be numerics stored as characters.

which.rates

A character giving the growth rates that are to be calculated. It should be a combination of one or more of "AGR", "PGR" and "RGR".

suffices.rates

A character giving the characters to be appended to the names of the responses in constructing the names of the columns containing the calculated growth rates. The order of the suffices in suffices.rates should correspond to the order of the elements of which.rates.

sep.rates

A character giving the character(s) to be used to separate the suffices.rates value from a response value in constructing the name for a new rate. 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 growth rate 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 growth rate is to be calculated.

suffix.interval

A character giving the suffix to be appended to response to form the names of the columns containing the calculated the growth rates.

sep.suffix.interval

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

Details

The AGR is calculated as the difference between the values of response at the end.time and start.time divided by the difference between end.time and start.time. The PGR is calculated as the ratio of response at the end.time to that at start.time and the ratio raised to the power of the reciprocal of the difference between end.time and start.time. The RGR is calculated as the log of the PGR and so is equal to the difference between the logarithms of response at the end.time and start.time divided by the difference between end.time and start.time.

Value

A data.frame with the growth rates. The name of each column is the concatenation of (i) one of responses, (ii) one of AGR, PGR or RGR, or the appropriate element of suffices.rates, and (iii) suffix.interval, the three components being separated by full stops.

Author(s)

Chris Brien

See Also

byIndv4Intvl_GRsAvg, byIndv4Intvl_WaterUse, getTimesSubset, GrowthRates,
byIndv4Times_SplinesGRs, splitContGRdiff

Examples

data(exampleData)
sPSA.GR <- byIndv4Intvl_GRsDiff(data = longi.dat, 
                                responses = "sPSA", times = "DAP", 
                                which.rates = c("AGR","RGR"), 
                                start.time = 31, end.time = 35,
                                suffix.interval = "31to35")

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