as.Track: Coercion to 'Track' objects

Description Usage Arguments Value Note Examples

Description

Coercion of Move, MoveBurst and ltraj objects to objects of class Track.

Just ltraj objects that contain exactly one trajectory may be coerced to Track objects.

For further details please see the vignette!

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'Move'
as.Track(obj)

## S4 method for signature 'MoveBurst'
as.Track(obj)

## S4 method for signature 'ltraj'
as.Track(obj)

Arguments

obj

object of class Move, MoveBurst or ltraj

Value

Object of class Track

Note

The method may be used in two ways: as(obj, "Track") or as.Track(obj)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load example data
data(wildboars_4Ind_ltraj)
# check object
class(wildboars_4Ind_ltraj)
# Subset a Track, adehabitatLT required
require(adehabitatLT)
oneLtraj <- wildboars_4Ind_ltraj[1]
class(oneLtraj)
length(oneLtraj)
summary(oneLtraj[[1]])
# Coerce to Track
track <- as(oneLtraj, "Track")
class(track)
slot(track, "data")
slot(track, "connections")

roland-h/trajaggr documentation built on Jan. 19, 2021, 1:02 p.m.