Skip to contents

Bar plot of denominator counts, outcome counts, and person-time from incidence results

Usage

plotIncidencePopulation(
  result,
  x = "incidence_start_date",
  y = "denominator_count",
  facet = NULL,
  colour = NULL
)

Arguments

result

Incidence results

x

Variable to plot on x axis

y

Variable to plot on y axis.

facet

Variables to use for facets. To see available variables for facetting use the functions availableIncidenceGrouping().

colour

Variables to use for colours. To see available variables for colouring use the function availableIncidenceGrouping().

Value

A ggplot object

Examples

# \donttest{
cdm <- mockIncidencePrevalence(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
  cdm = cdm, name = "denominator",
  cohortDateRange = c(as.Date("2014-01-01"), as.Date("2018-01-01"))
)
#>  Creating denominator cohorts
#> ! cohort columns will be reordered to match the expected order:
#>   cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date.
#>  Cohorts created in 0 min and 2 sec
inc <- estimateIncidence(
  cdm = cdm,
  denominatorTable = "denominator",
  outcomeTable = "outcome"
)
#>  Getting incidence for analysis 1 of 1
#>  Overall time taken: 0 mins and 1 secs
plotIncidencePopulation(inc)

# }