Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ld

Quick Conversion of Objects of Class ltraj from and to Dataframes


Description

The two functions ld and dl are useful to quickly convert objects of class ltraj from and to dataframes.

Usage

ld(ltraj)
dl(x, proj4string=CRS())

Arguments

ltraj

an object of class ltraj

x

an object of class data.frame, containing at least columns named x,y,date.

proj4string

a valid CRS object containing the projection information.

Details

The function ld concatenates all bursts in an object of class ltraj, adds two columns named id and burst, and, when it is present, also adds the variables in the infolocs component.

The function dl creates an object of class ltraj from a data.frame. If no column named id exists, a random ID is generated. If no column named burst exists, the ID is used as burst. The columns named "dx", "dy", "dist", "dt", "R2n", "abs.angle" and "rel.angle" are recomputed by the function (see ?as.ltraj). Additional columns are used as the infolocs component.

Value

ld returns an object of class data.frame.
dl returns an object of class ltraj.

Author(s)

See Also

as.ltraj for additional information about objects of class ltraj

Examples

data(puechcirc)
 puechcirc ## class ltraj
 uu <- ld(puechcirc)
 head(uu)
 dl(uu)

adehabitatLT

Analysis of Animal Movements

v0.3.25
GPL (>= 2)
Authors
Clement Calenge, contributions from Stephane Dray and Manuela Royer
Initial release
2020-01-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.