Learn R Programming

m2b (version 1.1.0)

xytb: xytb class constructor

Description

The methods to build an xytb object (see xytb-class for the class description).

Usage

xytb(object, desc, winsize, idquant, move, ...)

# S4 method for missing,missing,ANY,ANY,ANY xytb(desc = "null xybt object")

# S4 method for data.frame,character,ANY,ANY,ANY xytb(object, desc, winsize, idquant, move, ...)

# S4 method for data.frame,character,vector,vector,ANY xytb(object, desc, winsize, idquant, move, ...)

# S4 method for data.frame,character,vector,vector,vector xytb( object, desc = "unknow track", winsize = seq(3, 13, 2), idquant = seq(0, 1, 0.25), move = c(5, 10), ... )

Value

an xytb object

Arguments

object

a data frame with 5 columns

idindividual idcharacter
xlongitudedecimal degree
ylatitudedecimal degree
tdate and timePOSIXct
bbehaviourcharacter

desc

vector of character describing the dataset

winsize

a numerical vector giving the length of the windows used to calculate moving standard deviation, average, mad and quantile for the speed (v), the distance (dist) and the relative angle (thetarel).

idquant

a numerical vector giving the quantiles to be calculated. For example if idquant=c(0,0.25,.5,1), the quantiles at 0% (min), 25% (first quartile), 50% (median) and 100% (max) will be calculated.

move

a numerical vector providing the shift used to computed parameters back in time. For example if move=c(5,10,100), the parameters will be shifted backward by 5, 10 and 100 locations. Optional.

...

part of the generic definition

Methods' signature

  • xytb(): generate an empty xytb object.

  • xytb(data.frame,character vector): generate an xytb object with track information (only slot desc, xyt and b are computed).

  • xytb(data.frame,character vector,numerical vector, numerical vector,numerical vector): generate an xytb object with track information (slots desc, xyt, b) and derived information dxyt and befdxyt. dxyt contains statistical derivatives of speed, distance and relative angle calculated on moving windows given by the winsize parameters. Statistical derivatides are standard deviation, mean, median absolute deviation and quantiles. Quantiles are defined by the idquant parameters. befdxyt contains dxyt values shifted back in time according to the move parameters.

Author

Laurent Dubroca

Examples

Run this code
#generate an empty xytb object
xytb()
#generate an xytb object with track information only
#track_CAGA_005 is a dataset
simplexytb<-xytb(track_CAGA_005,"a track")
#generate a complete xytb object with derived (over moving windows of 3, 5
#and 9 points, with quantile at 0, 50 and 100%) and shifted information on 10
#and 100 points
xytb<-xytb(track_CAGA_005,"a track",c(3,5,9),c(0,.5,1),c(10,100))

Run the code above in your browser using DataLab