View source: R/transformations.R
move | R Documentation |
Turns visits to mulitple loggers into movements between loggers
move(v, all = FALSE, pass = TRUE)
v |
Dataframe. A visits data frame (may contain multiple animal_ids). From
the output of |
all |
Logical. Should all animal_ids be returned, even if the animal made no
movements? If TRUE, a data frame with NAs for all columns except
|
pass |
Logical. Pass 'extra' columns through the function and append them to the output. |
A data frame of movements. These are defined as the bout of time from leaving one logger to arriving at a second one. Each movement bout consists of two rows of data containing:
ID of the animal (animal_id
)
Date of event (date
)
Time of event (time
)
The ID of loggers involved (logger_id
)
The movement path including direction (move_dir
)
The movement path independent of direction (move_path
)
The 'strength' of the connection (inverse of time taken to move
between; strength
)
Information on whether left/arrived (direction
)
The ID of a single move event for a particular individual (move_id
)
Any extra columns pass
ed through
v <- visits(finches) m <- move(v) # Summarize (divide by 2 because 2 rows per event) library(dplyr) m.totals <- m %>% group_by(animal_id, move_path) %>% summarize(n_path = length(move_path) /2) # Calculate across different experiments: v <- chickadees %>% group_by(experiment) %>% do(visits(.)) m <- v %>% group_by(experiment) %>% do(move(.))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.