awr_aggregate: Aggregate antibiotic usage data by AWaRe group

View source: R/awr_funs.R

awr_aggregateR Documentation

Aggregate antibiotic usage data by AWaRe group

Description

Aggregate antibiotic usage data by AWaRe group

Usage

awr_aggregate(
  df,
  atc = atc,
  ddd = ddd,
  ...,
  tall = FALSE,
  method = getOption("abxaware.method", "dk"),
  ignore.other = FALSE,
  silent = FALSE
)

Arguments

df

Data frame.

atc

ATC code.

ddd

Amount (usually Defined Daily Doses).

...

Grouping variables.

tall

If TRUE (default) outputs data in tall format.

method

'dk' (default), uk or 'who' indicating the AWaRe classification to be used. The default may be changed within an R session using options(abxaware.method = 'who').

ignore.other

If TRUE, ignores drugs that have no AWaRe class.

silent

If TRUE, prints method.

Value

A data frame.

Examples

awr_aggregate(abx_sales)
awr_aggregate(abx_sales, atc, ddd)
awr_aggregate(abx_sales, atc, ddd, region)
awr_aggregate(abx_sales, atc, ddd, region, tall = TRUE)
awr_aggregate(abx_sales, atc, ddd, month)
awr_aggregate(abx_sales, atc, ddd, month, region)
awr_aggregate(abx_sales, atc, ddd, month, region, hospital)


anhoej/abxaware documentation built on Feb. 8, 2024, 1:29 a.m.