| spap {heR.Activities} | R Documentation |
Split an activity pattern data file based on factors
f and conduct various statistics using astat and aper
spap(x, f, w = NULL, stat=TRUE, ...)
x |
vector matrix of data frame of activity pattern data for a series of individuals (time spent) |
f |
factors used to split the data in x |
w |
vector of weights corresponding to individuals in x |
stat |
logical, whether to just return statistics or return a plot also |
... |
additional parameters |
Function to calculate statistics from a split activity pattern data (weighted/unweighted): proportion of "doers", overall mean, doer mean. "Doers" are those who spend a non-zero amount of time in a location or engaged in some activity.
x is a vector containing the activity pattern data
data: time spent in an activity or location per
subject (per row); w is an optional vector of weights
corresponding to each subject. Rows from the data
and the weights are removed if w contains NA's. NA's
are also removed from the data by the mean and
weighted.mean functions.
Results are returned in the form of a list of data frames for each level of the factor with rows corresponding to each location or activity and each column corresponding to each statistic
Neil E. Klepeis
http://klepeis.net
http://klepeis.net