summary_fun: summary function that applies a function to whole data frame...

View source: R/summary_fun.R

summary_funR Documentation

summary function that applies a function to whole data frame while removing na values

Description

summary function that applies a function to whole data frame while removing na values

Usage

summary_fun(df, fun)

Arguments

df

A data frame that is interested to apply a summary function to (eg. mean, standard deviation)

fun

a function to apply for the input df

Value

a data.frame that shows a summary statistic for each column in the original input df, and rounded to one decimal place

Examples

summary_fun(mtcars, mean)
summary_fun(mtcars, sd)
summary_fun(mtcars, max)

DSCI-310/DSCI-310-Group-8-package documentation built on April 21, 2022, 3:55 a.m.