Visualise the output of summarisePerson()
Arguments
- result
A summarised_result object (output of
summarisePerson()).- variableName
The variable to plot, a choice between
unique(result$variable_name). IfNULLit will only work if only one variable is present in the result object.- style
Visual theme to apply. Character, or
NULL. If a character, this may be either the name of a built-in style (seevisOmopResults::plotStyle()), or a path to a .yml file that defines a custom style. IfNULL, the function will use the explicit default style, unless a global style option is set (seevisOmopResults::setGlobalPlotOptions()) or a _brand.yml file is present (in that order).- type
Character string indicating the output plot format. See
visOmopResults::plotType()for the list of supported plot types. Iftype = NULL, the function will use the global setting defined viavisOmopResults::setGlobalPlotOptions()(if available); otherwise, a standardggplot2plot is produced by default.
Examples
# \donttest{
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
#> ℹ Loading bundled GiBleed tables from package data.
#> ℹ Adding drug_strength table.
#> ℹ Creating local <cdm_reference> object.
#> ℹ Inserting <cdm_reference> into duckdb.
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/RtmpHDb1h0/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
result <- summarisePerson(cdm = cdm)
tablePerson(result = result)
#> ! The following column types were changed:
#> • variable_name: from integer to character
Summary of person table
cdmDisconnect(cdm = cdm)
# }
