plotPrevalence {IncidencePrevalence} | R Documentation |
Plot prevalence results
Description
Plot prevalence results
Usage
plotPrevalence(
result,
x = "prevalence_start_date",
ylim = c(0, NA),
ribbon = FALSE,
facet = NULL,
colour = NULL,
colour_name = NULL,
options = list()
)
Arguments
result |
Prevalence results |
x |
Variable to plot on x axis |
ylim |
Limits for the Y axis |
ribbon |
If TRUE, the plot will join points using a ribbon |
facet |
Variables to use for facets |
colour |
Variables to use for colours |
colour_name |
Colour legend name |
options |
a list of optional plot options |
Value
A ggplot with the prevalence results plotted
Examples
cdm <- mockIncidencePrevalenceRef(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)
[Package IncidencePrevalence version 0.7.4 Index]