track: Create a track_*

View source: R/track.R

trackR Documentation

Create a ⁠track_*⁠

Description

Constructor to crate a track, the basic building block of the amt package. A track is usually created from a set of x and y coordinates, possibly time stamps, and any number of optional columns, such as id, sex, age, etc.

Usage

mk_track(
  tbl,
  .x,
  .y,
  .t,
  ...,
  crs = NA_crs_,
  order_by_ts = TRUE,
  check_duplicates = FALSE,
  all_cols = FALSE,
  verbose = FALSE
)

make_track(
  tbl,
  .x,
  .y,
  .t,
  ...,
  crs = NA_crs_,
  order_by_ts = TRUE,
  check_duplicates = FALSE,
  all_cols = FALSE,
  verbose = FALSE
)

track(x, y, t, ..., crs = NULL)

Arguments

tbl

⁠[data.frame]⁠
The data.frame from which a track should be created.

.x, .y, .t

⁠[expression(1)]⁠
Unquoted variable names of columns containing the x and y coordinates, and optionally a time stamp.

...

⁠[expression]⁠
Additional columns from tbl to be used in a track. Columns should be provided in the form of key = val (e.g., for ids this may look like this ⁠id = c(1, 1, 1, 2, 2, 2⁠ for three points for ids 1 and 2 each).

crs

⁠[crs]⁠
An optional coordinate reference system of the points. Usually just the epsg code is sufficient.

order_by_ts

⁠[logical(1)]⁠
Should relocations be ordered by time stamp, default is TRUE.

check_duplicates

⁠[logical(1)=FALSE]⁠
Should it be checked if there are duplicated time stamp, default is FALSE.

all_cols

⁠[logical(1)=FALSE]⁠
Should all columns be carried over to the track object, default is FALSE.

verbose

⁠[logical(1)=FALSE]⁠
Inform when tracks are created.

x, y

⁠[numeric]⁠
The x and y coordinates.

t

⁠[POSIXct]⁠
The time stamp.

Value

If t was provided an object of class track_xyt is returned otherwise a track_xy.


amt documentation built on June 25, 2024, 1:14 a.m.