as.MoveStack: Coercion to 'MoveStack' objects

Description Usage Arguments Value Note Examples

Description

Coercion of Tracks and TracksCollection objects to objects of class MoveStack.

For further details please see the vignette!

Usage

1
2
3
4
5
## S4 method for signature 'TracksCollection'
as.MoveStack(obj)

## S4 method for signature 'Tracks'
as.MoveStack(obj)

Arguments

obj

object of class Tracks or TracksCollection

Value

Object of class MoveStack

Note

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

The coercion to MoveStack objects just works if the package move or at least the package sp is explicitly loaded.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Load example toy data
load(system.file("extdata","trajaggr_TestData.RData", package = "trajaggr"), verbose = FALSE)
## Example 1: Coerce Tracks to MoveStack
require(move)
move_Trcs_A <- as.MoveStack(Tracks_A)
slot(Tracks_A[1], "data")
class(move_Trcs_A)
slot(move_Trcs_A, "data")[1:6, ]
slot(Tracks_A[2], "time")
slot(move_Trcs_A, "timestamps")[7:11]
##
## Example 2: Coerce TracksCollection to MoveStack
move_TrColl <- as.MoveStack(TrColl)
class(move_TrColl)
dim(TrColl)
length(unique(slot(move_TrColl, "trackId")))
slot(TrColl[2][2], "data")
slot(move_TrColl, "data")[18:21, 1, drop = FALSE]

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