traj_geom: Return a list of sf_POINTS or a data.frame from a sftraj...

traj_geomR Documentation

Return a list of sf_POINTS or a data.frame from a sftraj object

Description

Return a list of sf_POINTS or a data.frame from a sftraj object

Usage

pts_traj(traj, sfc = FALSE)

coord_traj(traj)

Arguments

traj

a trajectory geometery from sf_traj

sfc

TRUE/FALSE should the return by an sfc or a list of points. Defaults to FALSE

Examples

#'
data("raccoon")
raccoon$timestamp <- as.POSIXct(raccoon$timestamp, "EST")
burstz <- list(id = raccoon$animal_id, month = as.POSIXlt(raccoon$timestamp)$mon)
# Input is a data.frame
my_traj <- as_sftraj(raccoon,
  time = "timestamp",
  error = NA, coords = c("longitude", "latitude"),
  group = burstz
)
print(my_traj, 5, 10)

# extract a list of points
pts_traj(my_traj)[1:10]

# or a data.frame of points
coord_traj(my_traj)[1:10]

sftrack documentation built on March 31, 2023, 7:27 p.m.