Learn R Programming

move2 (version 0.4.4)

filter_track_data: dplyr functions to manipulate the track data

Description

  • filter_track_data filter data based on a track attribute (e.g. select all juveniles). Based on filter.

  • select_track_data keep or drop attributes in the track data. Based on select.

  • mutate_track_data create or modify attributes in the track data. Based on mutate.

  • group_by_track_data group by one or more attribute of the track data (e.g. group by sex, by taxon, by life stage, etc). Based on group_by.

Usage

filter_track_data(.data, ..., .track_id = NULL)

select_track_data(.data, ...)

mutate_track_data(.data, ...)

group_by_track_data( .data, ..., .add = FALSE, .drop = dplyr::group_by_drop_default(.data) )

Value

a move2 object

Arguments

.data

the move2 object

...

The identifiers of one or more tracks to select or selection criteria based on track attributes

.track_id

A vector of the ids of the tracks to select

.add

see original function docs group_by

.drop

see original function docs group_by

Examples

Run this code
## simulating a move2 object with 4 tracks
data <- mt_sim_brownian_motion(tracks = letters[1:4])

## retaining tracks "b" and "d"
data |>
  filter_track_data(.track_id = c("b", "d"))

## adding the attribute "sex" to the track data
data <- data |>
  mutate_track_data(sex = c("m", "f", "f", "m"))

## retaining tracks of females
data |> filter_track_data(sex == "f")

Run the code above in your browser using DataLab