powered by
This is a formatting function for consistent number reporting.
cff(num, low_ci, up_ci, dig = 0, method = c("num_only", "num_ci", "ci"))
A character vector with the formatted number(s)
A numeric. The number to format.
A numeric. Lower end of a confidence interval
A numeric. Upper end of a confidence interval
A numeric. Number of digits
What sort of printing do you need? (see Details)
Set method according to the printing you like: a unique number with num_only (default), the number and its confidence interval with num_ci, a ci only (for example a range of time to onset) The function properly returns NA when input is missing.
method
num_only
num_ci
ci
NA
num <- c(0.1, 0.02, 1.658) cff(num) cff(num, dig = 2) cff(num = num[[1]], low_ci = num[[2]], up_ci = num[[3]], method = "num_ci", dig = 2)
Run the code above in your browser using DataLab