Description Usage Arguments Details Value Examples
View source: R/summarize_variables.R
Calculate the average velocity for a movement path.
| 1 | summaryAvgVelocity(list, summary.df = NA)
 | 
| list | A list of data frames, each of which has a column for velocity. | 
| summary.df | The data frame object within which you are storing path
summary variables. The default is NA if you do not currently have a summary
data frame object started. When set to  | 
Calculate the average velocity for a movement path. The units on velocity are equal to the distance units used to record the data per second.
The inputed summary data frame or a new data frame if summary.df is
NA
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # If a summary data frame has not been started
 servosphere <- list(data.frame(id = rep(1, 200),
                                stimulus = rep(c(0, 1), each = 100),
                                dT = sample(8:12, 200, replace = TRUE),
                                dx = runif(200, 0, 5),
                                dy = runif(200, 0, 5),
                                treatment = rep("a", 200),
                                date = rep("2032018", 200)),
                     data.frame(id = rep(2, 200),
                                stimulus = rep(c(0, 1), each = 100),
                                dT = sample(8:12, 200, replace = TRUE),
                                dx = runif(200, 0, 5),
                                dy = runif(200, 0, 5),
                                treatment = rep("b", 200),
                                date = rep("2032018", 200)))
servosphere <- calcVelocity(servosphere)
summary_df <- summaryAvgVelocity(servosphere, summary.df = NA)
# If a summary data frame has been started
summary_df <- data.frame(id = c(1, 2),
                         treatment = c("a", "b"),
                         date = c("2032018", "2042018"),
                         stimulus = c(0, 0))
summary_df <- summaryAvgVelocity(servosphere, summary.df = summary_df)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.