Description Usage Arguments Examples
Calculate the 'Distance Travelled' by the Multivariable System
1 2 | distance_traveled(dataIn, group.vars = c("variable"), derivs = T,
print = T)
|
dataIn |
A data frame containing columns 'value', 'time', and any number of state variables (the order of all columns is irrelevant). |
group.vars |
Character vector of state variable(s) (e.g., species) to be used as grouping variables. Distances will be calculated indiviudally over time, according to these grouping variables. Default = 'variable' |
derivs |
Logical (Default = T), calculate derivatives of distance traveled? |
value |
The values over which distance will be calculated (e.g., species abundances). |
1 2 3 4 5 6 7 | time <- c(1:20)
value <- rnorm(n=20)
variable <- rep(c('a','b'), 20)
dist <- distance_traveled(data.frame(time, variable, value))
plot( dist$time, dist$s) # Cumulative distance traveled
plot( dist$time, dist$dsdt) # Velocity = First derivative of s (Ds/t or dsdt or s')
plot( dist$time, dist$d2sdt2) # Acceleration = Second derivative of s (Ds/t or dsdt or s')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.