Learn R Programming

visOmopResults (version 0.4.0)

barPlot: Create a bar plot visualisation from a <summarised_result> object

Description

[Experimental]

Usage

barPlot(result, x, y, facet = NULL, colour = NULL)

Value

A plot object.

Arguments

result

A <summarised_result> object.

x

Column or estimate name that is used as x variable.

y

Column or estimate name that is used as y variable

facet

Variables to facet by, a formula can be provided to specify which variables should be used as rows and which ones as columns.

colour

Columns to use to determine the colors.

Examples

Run this code
# \donttest{
result <- mockSummarisedResult() |> dplyr::filter(variable_name == "age")

barPlot(
  result = result,
  x = "cohort_name",
  y = "mean",
  facet = c("age_group", "sex"),
  colour = "sex")
# }

Run the code above in your browser using DataLab