powered by
Apply a function to columns in a data.frame that inherit one of the specified types.
data.frame
typly( data, f, types, negated = FALSE, ... )
A list
list
A data.frame.
A function.
function
A character vector of classes to test against.
character
Should the function be applied to columns that don't match any types? Defaults to FALSE.
types
FALSE
Additional arguments to be passed to f.
f
Alex Zajichek
heart_disease %>% #Compute means on numeric or logical data typly( f = mean, types = c("numeric", "logical"), na.rm = TRUE )
Run the code above in your browser using DataLab