Splits the values of a response into subsets corresponding individuals and applies a function that calculates a single value to each individual's observations. It includes the ability to calculate the observation that corresponds to the calculated value of the function.
splitValueCalculate(response, weights=NULL, individuals = "Snapshot.ID.Tag",
FUN = "max", which.obs = FALSE, which.levels = NULL,
data, na.rm=TRUE, sep=".", ...)
A data.frame
, with the same number of rows as there are
individuals
, containing the values of the function for the
individuals
.
A character
giving the name of the column in
data
from which the values of FUN
are to be
calculated.
A character
giving the name of the column in
data
containing the weights to be supplied as w
to FUN
.
A character
giving the name(s) of the
factor
(s) that define the subsets of the data
for
which each subset corresponds to the response
value for an
individual.
A character
giving the name of the function
that calculates the value for each subset.
A logical
indicating whether or not to determine
the observation corresponding to the value of the function,
instead of the value of the function itself.
A character
giving the name of the
factor
whose levels are to be identified as
the level of the observation whose value matches the
value of the function.
A data.frame
containing the column from which the
function is to be calculated.
A logical
indicating whether NA
values
should be stripped before the calculation proceeds.
A character
giving the separator to use when the
levels of individuals
are combined. This is needed to avoid
using a character
that occurs in a factor to delimit
levels when the levels of individuals
are combined to
identify subsets.
allows for arguments to be passed to FUN
.
Chris Brien
splitContGRdiff
, splitSplines
data(exampleData)
Area.smooth.max <- splitValueCalculate("Area.smooth", data = longi.dat)
Run the code above in your browser using DataLab