View source: R/summary_stats.R
summary_statsNum | R Documentation |
This function computes the summary statistics of one or more variables. It can receives a grouped data.frame.
summary_statsNum(df, var, peso = NULL)
df |
A data.frame. |
var |
Character. Variable/s name. |
peso |
Character.A numeric vector of weights. Default is NULL. |
A dataframe.
library(dplyr)
summary_statsNum(mtcars, 'disp')
mtcars %>%
group_by(cyl) %>%
summary_statsNum('mpg')
mtcars %>%
mutate( 'peso' = runif(32) ) %>%
group_by( cyl ) %>%
summary_statsNum(c('mpg','disp'), peso = 'peso')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.