Learn R Programming

wildlifeDI (version 0.5.1)

sf2ltraj: Convert sf spatial object to ltraj

Description

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

Usage

sf2ltraj(sfp, date, id)

Value

A ltraj object. For more information on objects of this type see help(ltraj) and ?as.ltraj.

Arguments

sfp

an object of the class sf which contains the time-stamped movement fixes (as points) of the object(s).

date

the name of the column containing the date-time information of each fix. Must be converted to a POSIXct type.

id

either a character string indicating the identity of the animal or the name of the column with the ID of the individuals.

Details

The function sf2ltraj can be used to convert an sf object (stored as points) into an ltraj object.

See Also

conSpatial, ltraj2sf

Examples

Run this code
data(deer)
#points
deer_pt <- ltraj2sf(deer)
deer_tr <- sf2ltraj(deer_pt, date='date', id='id')

Run the code above in your browser using DataLab