Apply a function to all variables
Find mean of all numeric columns of a Data Frame
lapply(mtcars, class) # find class of all predictors
## $mpg
## [1] "numeric"
##
## $cyl
## [1] "character"
##
## $disp
## [1] "numeric"
##
## $hp
## [1] "numeric"
##
## $drat
## [1] "numeric"
##
## $wt
## [1] "numeric"
##
## $qsec
## [1] "numeric"
##
## $vs
## [1] "numeric"
##
## $am
## [1] "character"
##
## $gear
## [1] "character"
##
## $carb
## [1 …