createSpatialTrajectories: Add spatial trajectories

addSpatialTrajectoryR Documentation

Add spatial trajectories

Description

Functions to add spatial trajectories to the spata2 object. For interactive drawing use createSpatialTrajectories(). To set them precisely with code use addSpatialTrajectory().

Usage

addSpatialTrajectory(
  object,
  id,
  width,
  segment_df = NULL,
  start = NULL,
  end = NULL,
  vertices = NULL,
  comment = base::character(1),
  overwrite = FALSE
)

createSpatialTrajectories(object)

Arguments

object

An object of class spata2.

id

Character value. The id of the spatial trajectory.

width

Distance measure. The width of the spatial trajectory.

segment_df

Data.frame with four numeric variables that describe the course of the trajectory, namely x, y, xend and yend.

start, end

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.

vertices

List of numeric vectors of length two or NULL. If list, sets additional vertices along the trajectory.

overwrite

Logical value. Must be TRUE to allow overwriting.

Value

The input spata2 object containing the added or computed results.

Examples


library(SPATA2)
library(SPATAData)

object_t269 <- loadSpataObject(sample_name = "269_T")

object_t269 <-
   addSpatialTrajectory(
     object = object_t269,
     id = "cross_sample",
     width = "1.5mm",
     start = c(x = "1.35mm", y = "4mm"),
     end = c(x = "6.25mm", y = "4mm"),
     overwrite = TRUE
   )

 plotSpatialTrajectories(object_t269, ids = "cross_sample")


kueckelj/SPATA2 documentation built on March 16, 2024, 10:25 a.m.