Learn R Programming

wildlifeDI (version 0.5.1)

ltraj2sf: Convert ltraj to sf spatial object

Description

The function ltraj2sf is a simple function for converting ltraj to sf objects.

Usage

ltraj2sf(traj, type = "point")

Value

A sf object either points or lines.

Arguments

traj

an object of the class ltraj which contains the time-stamped movement fixes of the object. For more information on objects of this type see help(ltraj).

type

One of "point" (the default) or "line".

Details

The function ltraj2sf can be used to convert an ltraj object into an sf spatial object (either as points or lines).

See Also

conSpatial,sf2ltraj

Examples

Run this code
data(deer)
#points
deer_pt <- ltraj2sf(deer)
plot(deer_pt['id'])

#lines
deer_ln <- ltraj2sf(deer,type='line')
plot(deer_ln['id'])

Run the code above in your browser using DataLab