View source: R/paste_with_error.R
paste_with_error | R Documentation |
Used to create tables for publication, where values are presented with their errors The function will also deal with NAs, omitting the sep and error if error is NA or returning a blank string the whole output if value is NA
paste_with_error(value, error, sep = " ± ", digits = 2)
value |
Numerical vector of value of a variable |
error |
Numerical vector of error assocciated with variable |
sep |
Separator for value and error values. Defaults to ± |
digits |
Number of digits to numbers to. Defaults to 2 |
# This table makes to sense, but it shows how the function works
library(dplyr)
mutate(cars, example = paste_with_error(speed, dist))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.