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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Trackstat.R

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

1
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

1
2
3
4
5
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)

Example output



trajectories documentation built on July 1, 2020, 11:42 p.m.