Learn R Programming

adehabitatLT (version 0.3.28)

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())

Value

ld returns an object of class data.frame.

dl returns an object of class ltraj.

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.

Author

Clement Calenge clement.calenge@ofb.gouv.fr

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.

See Also

as.ltraj for additional information about objects of class ltraj

Examples

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

Run the code above in your browser using DataLab