adehabitatLT (version 0.3.23)

ltraj2spdf: Conversion of the class "ltraj" to the package "sp"

Description

These functions convert the class "ltraj" available in adehabitatLT toward classes available in the package sp.

ltraj2spdf converts an object of class ltraj into an object of class SpatialPointsDataFrame.

ltraj2sldf converts an object of class ltraj into an object of class SpatialLinesDataFrame.

Usage

ltraj2spdf(ltr)
ltraj2sldf(ltr, byid = FALSE)

Arguments

ltr

an object of class ltraj.

byid

logical. If TRUE, one objects of class Lines correspond to one animal. if FALSE, one object of class Lines correspond to one burst.

See Also

ltraj for objects of class ltraj.

Examples

Run this code
# NOT RUN {
if (require(sp)) {



#########################################
##
## Conversion ltraj -> SpatialPointsDataFrame
##

data(puechcirc)
plot(puechcirc)

toto <- ltraj2spdf(puechcirc)
plot(toto)



#########################################
##
## Conversion ltraj -> SpatialLinesDataFrame
##

toto <- ltraj2sldf(puechcirc)
plot(toto)


}
# }

Run the code above in your browser using DataCamp Workspace