#' Quick descriptive statistics
#'
#' This function provides basic summary statistics
#' @keywords descriptives
#' @param data a dataframe object
#' @param ... dataframe columns
#' @export
#' @examples
#' describe()
describe = function(data, ...){
argList = match.call(expand.dots = FALSE)$...
cat(paste("_________________________________________", "\n"))
for(i in 1:length(argList)){
colName = argList[[i]]
series_colName = eval(substitute(colName), envir = data, enclos = parent.frame())
cat(colName,":", "\n", "\n")
cat("Mean :", mean(series_colName, na.rm = T), "\n")
cat("SD :", sd(series_colName, na.rm = T), "\n")
cat("Min :", min(series_colName), "\n")
cat("Max :", max(series_colName), "\n")
cat("N :", length(series_colName), "\n")
cat("NA :", sum(is.na(series_colName)), "\n")
cat(paste("_________________________________________", "\n"))
}
}
#document()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.