plotPrevalence | R Documentation |
Plot prevalence results
plotPrevalence(
result,
x = "prevalence_start_date",
y = "prevalence",
line = FALSE,
point = TRUE,
ribbon = FALSE,
ymin = "prevalence_95CI_lower",
ymax = "prevalence_95CI_upper",
facet = NULL,
colour = NULL
)
result |
Prevalence results |
x |
Variable to plot on x axis |
y |
Variable to plot on y axis. |
line |
Whether to plot a line using |
point |
Whether to plot points using |
ribbon |
Whether to plot a ribbon using |
ymin |
Lower limit of error bars, if provided is plot using |
ymax |
Upper limit of error bars, if provided is plot using |
facet |
Variables to use for facets. To see available variables for
facetting use the function |
colour |
Variables to use for colours. To see available variables for
colouring use the function |
A ggplot with the prevalence results plotted
cdm <- mockIncidencePrevalence(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
cdm = cdm, name = "denominator",
cohortDateRange = c(as.Date("2014-01-01"), as.Date("2018-01-01"))
)
prev <- estimatePointPrevalence(
cdm = cdm,
denominatorTable = "denominator",
outcomeTable = "outcome"
)
plotPrevalence(prev)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.