1 | ci_mean(x)
|
x |
Must be a dataframe with at least two variables. |
normal |
Default is Student Distribution. Normal = T for a Normal Distribution. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | x = mtcars [,c('mpg', 'disp', 'hp')]
# or even the entire dataset #
x = mtcars
ci_mean(x, normal = F)
# barplot with CI #
library(dplyr)
library(ggplot2)
library(ggthemes)
xyz = ci_mean(x, normal = F)
ggplot(xyz, aes(reorder(variable, desc(mean)), mean, fill = variable)) +
geom_bar(stat = 'identity') + theme_tufte() +
xlab('') +
geom_errorbar(aes(ymin=low, ymax=high), width=.1, colour = 'black') +
geom_rangeframe(show.legend = F) +
geom_text(aes(label = paste(round(mean), 'min', sep = '')), size = 5, colour = 'gray77', vjust = -1, position=position_dodge(width=0.9)) +
scale_fill_calc(guide = F)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.