track_ {trackdf} | R Documentation |
Build a Track Table
Description
track
constructs track tables based on data.frame
(the default), tibble
, or data.table
.
track
is a convenience function that executes track_df
,
track_tbl
, or track_dt
based on the value of the 'table'
parameter. Track tables can be used like the data structure they are build
upon but with a notable difference: they have an extra attribute to store
the projection of the track coordinates, and modifying the projection will
automatically trigger the appropriate conversion of the coordinates.
Usage
track(x, y, z, t, id, ..., proj, origin, period, tz, format, table = "df")
track_df(x, y, z, t, id, ..., proj, origin, period, tz, format)
track_tbl(x, y, z, t, id, ..., proj, origin, period, tz, format)
track_dt(x, y, z, t, id, ..., proj, origin, period, tz, format)
Arguments
x , y , z |
Numeric vectors representing the coordinates of the locations.
|
t |
A numeric vector or a vector of objects that can be coerced to
date-time objects by |
id |
A vector that can be coerced to a character vector by
|
... |
A set of name-value pairs. Arguments are evaluated sequentially,
so you can refer to previously created elements. These arguments are
processed with |
proj |
A character string or a |
origin |
Something that can be coerced to a date-time object by
|
period |
A character vector in a shorthand format (e.g. "1 second") or
ISO 8601 specification. This is used when |
tz |
A time zone name. See |
format |
A character string indicating the formatting of 't'. See
When supplied parsing is performed by strptime(). For this reason consider using specialized parsing functions in lubridate. |
table |
A string indicating the class of the table on which the track
table should be built. It can be a |
Value
A track table, which is a colloquial term for an object of class
track
.
Author(s)
Simon Garnier, garnier@njit.edu
Examples
data(short_tracks)
t_df <- track(x = short_tracks$x, y = short_tracks$y, t = short_tracks$t,
id = short_tracks$id, proj = "+proj=longlat", tz = "Africa/Windhoek", table = "df")
t_df <- track_df(x = short_tracks$x, y = short_tracks$y, t = short_tracks$t,
id = short_tracks$id, proj = "+proj=longlat", tz = "Africa/Windhoek")
t_tbl <- track_tbl(x = short_tracks$x, y = short_tracks$y, t = short_tracks$t,
id = short_tracks$id, proj = "+proj=longlat", tz = "Africa/Windhoek")
t_dt <- track_dt(x = short_tracks$x, y = short_tracks$y, t = short_tracks$t,
id = short_tracks$id, proj = "+proj=longlat", tz = "Africa/Windhoek")