A function to convert number of days into either number of weeks,
months or years with specific bin values.
Details
A small positive values will be added to zero numeric value, specially to
adjust time interval for baseline visits.
Furthermore, all negative value will be ceiling to zero if adjust_negative_value is set to TRUE
See also
Other Utility functions used for preparing analysis data:
get_numeric_dx_status()
Examples
if (FALSE) { # \dontrun{
set.seed(123456)
x <- rnorm(100, mean = 100, sd = 10)
# Convert number of days into number of weeks
convert_number_days(x = x, unit = "week", bin = 1, digits = 1L)
# Convert number of days into number of months binned into 3 months
convert_number_days(x = x, unit = "month", bin = 3, digits = 2L)
# Convert number of days into number of years
convert_number_days(x = x, unit = "year", bin = 1, digits = 5L)
} # }
