This function gives you the mean and the median of a dataset

mean_med(df, var)

Arguments

df

Name of the Dataset

var

Variable to find the mean and median of

Examples

money1 <- read_csv("https://raw.githubusercontent.com/ryanburge/pls2003_sp17/master/sal_work.csv")
#> Warning: Missing column names filled in: 'X1' [1]
#> Parsed with column specification: #> cols( #> X1 = col_double(), #> salary = col_double(), #> names = col_character() #> )
money1 %>% mean_med(salary)
#> # A tibble: 1 x 2 #> mean median #> <dbl> <dbl> #> 1 1247953. 35853