R/get_stats.R
get_data_Stats.Rd
A pipe friendly way to get summary stats for exploratory data analysis
get_data_Stats( x = NULL, func = NULL, exclude = NULL, na.rm = FALSE, na_action = NULL, ... ) get_stats( x = NULL, func = NULL, exclude = NULL, na.rm = FALSE, na_action = NULL, ... )
x | The data for which stats are required |
---|---|
func | The nature of function to apply |
exclude | What kind of data should be excluded? Use for example c("character","factor") to drop character and factor columns |
na.rm | Logical. Should NAs be removed. Defaults to FALSE. |
na_action | If na.rm is set to TRUE, this uses na_replace to replace missing values. |
... | Other arguments to na_replace See ?na_replace for details. |
A data.frame object showing the requested stats
A convenient wrapper especially useful for get_mode
head(get_data_Stats(airquality,mean,na.rm = TRUE,na_action = "get_mode")) #> Ozone Solar.R Wind Temp Month Day #> 37.503268 189.274510 9.957516 77.882353 6.993464 15.803922 get_stats(airquality,mean,"non_numeric",na.rm = TRUE,na_action = "get_mode") #> Warning: Columns with classes in exclude have been discarded #> Ozone Solar.R Wind Temp Month Day #> 37.503268 189.274510 9.957516 77.882353 6.993464 15.803922