Displays discrete variables along a trajectory.

plotStsBarplot(
  object,
  grouping,
  id = idST(object),
  resolution = getCCD(object) * 2,
  unit = getDefaultUnit(object),
  round = 2,
  clrp = NULL,
  clrp_adjust = NULL,
  position = "fill",
  bar_width = 0.9,
  expand_x = c(0.025, 0),
  expand_y = c(0.0125, 0),
  verbose = NULL,
  ...
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

grouping

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

resolution

Distance measure. The resolution with which the expression gradient is inferred. Defaults are platform specific. See more in detail section of recSgsRes().

unit

Character value. Specifies the desired unit in which distance measures or area measures are provided. Run validUnitsOfLength() or validUnitsOfArea() for valid input options.

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.

expand_x, expand_y

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

verbose

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

(Warning messages will always be printed.)

...

Used to absorb deprecated arguments or functions.

Value

A ggplot.

Examples

library(SPATA2)

data("example_data")

object <- example_data$object_UKF269T_diet

plotStsBarplot(object, grouping = "histology", id = "horizontal_mid")