Plots a mosaic plot of two grouping variables.

plotMosaicplot(
  object,
  grouping_variable,
  fill_by,
  clrp = NULL,
  clrp_adjust = NULL,
  ...
)

Arguments

object

An object of class spata2.

grouping_variable

Character value. The grouping variable that is plotted on the x-axis.

fill_by

Character value. The grouping variable that is used to fill the mosaic.

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.

...

Additional arguments given to ggmosaic::geom_mosaic()

Value

Returns a ggplot-object that can be additionally customized according to the rules of the ggplot2-framework.