# NOT RUN {
f_parenthesis(
f_num(sample(50:100, 5), 1),
f_num(rnorm(5, 5:15, 5), 1),
prefix = 'mean = ',
parenthesis_prefix = 'sd = ',
sep = " "
)
f_mean_sd(rnorm(5, 100, 20), rnorm(5, 20, 5))
f_num_percent(rnorm(5, 100, 20), rnorm(5, .5, .1))
f_parenthesis(
sample(50:100, 5),
f_prop2percent(rnorm(5, .5, .1), 0)
)
# }
# NOT RUN {
library(tidyverse)
mtcars %>%
group_by(cyl) %>%
summarize(
mean = mean(hp),
sd = sd(hp),
n = n()
) %>%
mutate(
prop = n /sum(n),
mean_sd = f_mean_sd(mean, sd),
n_perc = f_num_percent(n, prop, 0)
)
# }
Run the code above in your browser using DataLab