df <-
data.frame(
smoke_status = c("smoker", "non-smoker",
"smoker", "smoker",
"smoker", "smoker",
"non-smoker"
),
age = c(60, 50, 56, 49, 75, 69, 85),
bmi = c(18, 30, 25, 22, 23, 21, 22)
)
# Use default formatting
desc_cont(.data = df, vc = c("age", "bmi"))
# Use custom formatting
desc_cont(.data = df,
vc = c("age", "bmi"),
format = "median (q1;q3)"
)
# You might want to export raw values, to run plotting or
# other formatting functions
desc_cont(.data = df, vc = c("age", "bmi"),
export_raw_values = TRUE)
Run the code above in your browser using DataLab