addSpatialTrajectory.Rd
Adds a spatial trajectory using coordinate input.
addSpatialTrajectory(
object,
id,
width = NULL,
traj_df = NULL,
start = NULL,
end = NULL,
comment = base::character(1),
overwrite = FALSE,
...
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character value. The id of the spatial trajectory.
Distance measure. The width of the spatial trajectory.
Numeric vectors of length two. Can be provided instead of
segment_df
. If so, start
corresponds to x and y and end
corresponds to
xend and yend of the segment.
Logical value. Must be TRUE
to allow overwriting.
Used to absorb deprecated arguments or functions.
Data.frame with x and y as variables corresponding to the vertices of the trajectory. IN case of more than three rows the trajectory is assumed to have a curve.
List of numeric vectors of length two or NULL
. If list,
sets additional vertices along the trajectory.
The updated input object, containing the added, removed or computed results.
library(SPATA2)
library(tidyverse)
data("example_data")
object <- example_data$object_UKF275T_diet
object <-
addSpatialTrajectory(
object = object,
id = "cross_sample",
width = "1.5mm",
start = c(x = "1.35mm", y = "4mm"),
end = c(x = "6.25mm", y = "4mm"),
overwrite = TRUE
)
plotSpatialTrajectories(object, ids = "cross_sample")