dplyr-track: 'dplyr' functions to manipulate the track data

filter_track_dataR Documentation

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)
)

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

Value

a move2 object

Examples

## 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")


move2 documentation built on April 4, 2025, 12:24 a.m.