makeTraj: Build a trajectory table

Description Usage Arguments Value Author(s) See Also Examples

View source: R/makeTraj.R

Description

Given a set of cartesian coordinates representing an object's trajectory, this function builds a trajectory table that can then be used to work with the functions provided by the swaRm package.

Usage

1
2
3
makeTraj(x, y, z = NULL, id = NULL, date = NULL, time = NULL,
  date.format = "ymd", time.format = "hms", tz = "UTC", fps = NULL,
  geo = FALSE)

Arguments

x

A vector of x (or longitude) coordinates corresponding to a single animal trajectory.

y

A vector of y (or latitude) coordinates corresponding to a single animal trajectory.

z

A vector of z (or altitude) coordinates corresponding to a single animal trajectory (default: NULL).

id

A unique identifier for the trajectory. It can be a number or a character string. If not set, it defaults to zero.

date

A character string corresponding to a date in year-month-day format. Alternatively, a vector of character strings of the same length as x and y (for instance if the trajectory spans multiple days). If not set, it default to January 1st, 1970.

time

A vector of character strings corresponding to the timestamps of each location of the trajectory, in hours-minutes-seconds format. If not set, the first timestamp defaults to 0 hours, 0 minutes, 1 second. The following timestamps are either in increment of 1 second or 1 second / fps.

date.format

A character string with 3 letters ('y' for year, 'm' for month, and 'd' for day) indicating the format of the date (e.g., 'ymd' for year-month-day, 'dmy' for day-month-year, etc).

time.format

A character string with 2 or 3 letters ('h' for hour, 'm' for minute, and 's' for second) indicating the format of the time (e.g., 'hms' for hour-minute-second, 'hm' for hour-minute, and 'ms' for minute-second).

tz

A character string identifying the timezone of the timestamps of the trajectory. Default: "UTC".

fps

A single numeric value corresponding to the sampling rate of the trajectory.

geo

A logical value indicating whether the locations are defined by geographic coordinates (pairs of longitude/latitude values). Default: FALSE.

Value

A trajectory table (see trackTable).

Author(s)

Simon Garnier, [email protected]

See Also

trackTable

Examples

1
# TODO

swarm-lab/swaRm documentation built on June 22, 2018, 5:21 p.m.