as.Track: Converts data to an object of class "Track"

View source: R/Trackstat.R

as.TrackR Documentation

Converts data to an object of class "Track"

Description

Function as.Track accepts converts x,y coordinates and thier corresponding time/date to an object of class Track. It can also accepts covariates for the corresponding locations, covariates must be a dataframe with some columns and length of each column is equal to length of x,y,t.

Usage

as.Track(x,y,t,covariate)

Arguments

x

x coordinate.

y

y coordinate.

t

corresponding time and date of x,y.

covariate

additional information.

Details

An object of class "Track" can be created by some geographical locations and corresponding time/dates. Function as.Track converts locations and dates/times to an object of class "Track". time/date should be from class "POSIXct" "POSIXt". See example below.

Value

An object of class "Track".

Author(s)

Mohammad Mehdi Moradi <moradi@uji.es>

See Also

Track, as.POSIXct

Examples

x <- runif(10,0,1)
y <- runif(10,0,1)
date <- seq(as.POSIXct("2015-1-1 0:00"), as.POSIXct("2015-1-1 9:00"), by = "hour")
Z <- as.Track(x,y,date)
plot(Z)

edzer/trajectories documentation built on Jan. 4, 2024, 8:37 p.m.