drug_tabler: Cohort drug frequency tables

Description Usage Arguments Value Author(s) See Also Examples

View source: R/drug_tabler.R

Description

Generate frequency tables for TB cohort data from Koch 6 which has been cleaned, and subsetted into a drug-spectific data frame.

Usage

1
drug_tabler(x, year = NULL, month = NULL)

Arguments

x

dataframe of combined and cleaned admission and change data from Koch 6

year

numerical 4 digit value representing year of interest - optional

month

numerical 2 digit value representing month of interest - optional

Value

list containg both a 3x2 frequency table with total row - subsetted by year and month if defined, and a formatted version for display in Rmd files

Author(s)

Jay Achar

See Also

tbreportr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- structure(list(id = 1:10, Starttre = structure(c(17211, 17634, 
17738, 17683, 16899, 16598, 17201, 16587, 16587, 16601), class = "Date"), 
Age = structure(c(1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L), 
               .Label = c("<= 18 years", 
                          ">18 years"), class = "factor")), 
                                        row.names = c(NA, -10L), 
                                        class = c("tbl_df", 
                                                  "tbl", "data.frame"))
drug_tabler(x)
drug_tabler(x, year = 2018)
drug_tabler(x, year = 2015, month = 06)

JayAchar/tbreportr documentation built on May 27, 2019, 12:01 a.m.