run.mar
prepare.data(data, increment=c("month","year","week","day"), fill.gap=0,
replace.0s=c(FALSE,"rand.half","add.ones"), log=FALSE,
z.method=c(FALSE,"standard","deseason"), order=NULL)
"rand.half" : | ||
replace zeros with random values less than 1/2 the minimum non-zero value for the variable | ||
"add.ones" : | add 1 to all values in time-series |
"standard" : | ||
subtracts the overall variable mean and divides by the overall variable standard deviation | ||
"deseason" : | subtracts the variable mean for the increment (across years) and divides by the variable | |
standard deviation for the increment |
data
. Defaults to NULL
, for which an attempt is made by the function to distinguish the date format, but the argument should be provided as "ymd", "mdy", etc., if the function cannot distinguish the order on its own
run.mar
function requires a data frame consisting of a continuous time-block indicator variable in the first column, dates/time-steps in the second column, and variable time-series with evenly spaced time-step increments in the remaining columns. This function automatically creates the continuous time-block variable column and aggregates the time-series into evenly spaced increments as indicated by the increment
argument. Although it automatically tries to assess the format of the dates in data
, the order
argument may have to be provided if this fails (for example, in the case where all dates in the dataset fall before the 12th of each month).Other transformations that are commonly applied to ecological data prior to MAR modeling (e.g., Hampton et al. 2006, Ives et al. 2003) can optionally be performed, but are skipped by default with their respective arguments set to FALSE.
Ives AR, Dennis B, Cottingham KL, and Carpenter SR (2003) Estimating community stability and ecological interactions from time-series data. Ecological Monographs 73:301-330
data(L4.AllDates)
L4.mar<-prepare.data(data=L4.AllDates, increment="month", fill.gap=0,
replace.0s="rand.half", log=TRUE, z.method="deseason")
Run the code above in your browser using DataLab