Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

track

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 = NULL,
  order_by_ts = TRUE,
  check_duplicates = FALSE,
  all_cols = FALSE
)

make_track(
  tbl,
  .x,
  .y,
  .t,
  ...,
  crs = NULL,
  order_by_ts = TRUE,
  check_duplicates = FALSE,
  all_cols = 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

[sp::CRS]
An optional coordinate reference system of the points.

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.

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

Animal Movement Tools

v0.1.4
GPL-3
Authors
Johannes Signer [aut, cre], Brian Smith [ctb], Bjoern Reineking [ctb], Ulrike Schlaegel [ctb], John Fieberg [ctb], Scott LaPoint [dtc]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.