ltraj2sf: Convert ltraj to sf spatial object

View source: R/ltraj2sf.R

ltraj2sfR Documentation

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

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

Value

A sf object either points or lines.

See Also

conSpatial,sf2ltraj

Examples

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

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

wildlifeDI documentation built on Nov. 14, 2023, 1:09 a.m.