my_summary | R Documentation |
Uses 'dplyr' style summarization to retrun mean, SD, n, SEM, and 95 single continuous variable in a dataframe. Useful for grouped data summaries.
my_summary(df, my_var, probs = c(0.025, 0.975), na.rm = T, digits = 2)
df |
A dataframe |
my_var |
A variable name |
probs |
For quantile functions, a vector with the desired quantiles...c(0.025, 0.975) default |
na.rm |
a logical value indicating whether NA values should be stripped |
digits |
integer indicating number of decimal places |
A dataframe with named variables for: mean, sd, n, sem, and 95
summarise
, mean
, sd
,
round
, quantile
library(dplyr)
my_summary(mtcars, mpg)
mtcars %>% group_by(cyl) %>% my_summary(mpg)
mtcars %>% group_by(cyl) %>% my_summary(mpg, probs = c(0.01, .999), digits = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.