Given a single integer vector (with origin specified) or data class vector, will compute median day and a range (default min/max) and percent of total, returning results in string. Mostly called by other functions.
num_dt(x, median = TRUE, range='min/max', origin=NULL)
range | A character string to indicate range values. options: 'min/max'. |
---|---|
origin | Default NULL. If specified, must be a date class object of length 1. For use if date variable is in raw integer format. |
x | A integer or date class vector |
nomedian | A logical vector, indicates whether to report median or not. Default = TRUE. |
A character string of length 1, 'Median date (date1, date2)'
require(mdsR)#>#>#>#> Warning: package 'rlang' was built under R version 3.5.2#> #>#>#> #>#>#> #>#>#> #> #> #>mds_dta <- mdsR::mds_cohort#> Error: 'mds_cohort' is not an exported object from 'namespace:mdsR'num_dt(mds_dta$dmdate)#> [1] "2015-03-22 (2013-01-02, 2018-07-18)"