Displays discrete variables along a trajectory.

plotTrajectoryBarplot(
  object,
  id,
  grouping_variable,
  binwidth = getCCD(object),
  unit = getSpatialMethod(object)@unit,
  round = 2,
  clrp = NULL,
  clrp_adjust = NULL,
  display_trajectory_parts = NULL,
  position = "fill",
  scales = "free_x",
  x_nth = 7L,
  expand_x = c(0.025, 0),
  expand_y = c(0.0125, 0),
  verbose = NULL,
  ...
)

Arguments

object

An object of class spata2.

id

Character value. The ID of the image annotation of interest.

grouping_variable

Character value. The grouping variable of interest. Use getGroupingOptions() to obtain all valid input options.

binwidth

Numeric value. Denotes the binwidth with which to sort all relevant barcode spots into groups that are then aligned with respect to the chosen trajectory's direction.#'

unit

Character value. The unit in which the distance to the image annotation is displayed on the x-axis.

If FALSE, plots the bin numbers instead.

round

Numeric value or FALSE. If numeric, given to digits of base::round(). Rounds transformed values before they are returned.

clrp

Character value. Specifies the color palette to be used to represent groups of discrete variables. Run validColorPalettes() to obtain valid input options.

clrp_adjust

Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group.

display_trajectory_parts

Logical. If set to TRUE the returned plot visualizes the parts in which the trajectory has been partitioned while beeing drawn.

x_nth

Numeric value. If the number of breaks/labels on the x-axis becomes too high x_nth can be used to reduce it. If x_nth is 1, every label is kept. If 2, every second label is kept. If 3, every third label is kept. And so on.

expand_x, expand_y

Given to argument expand of ggplot2:scale_x/y_continuous().

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

...

Additional arguments given to ggplot2::facet_wrap().

feature

Character value. The grouping feature of interest.

Value

A ggplot.