#' Creates Histogram, Box plot and Numerical Summary
#' @export
#' @param x numeric variable
stat <- function(x){
#1 row and 2 columns
par(mfrow = c(1,2))
# Histogram
hist(x, col = rainbow(30))
#Box plot
boxplot(x, col = "red")
# 1 row and 1 column
par(mfrow = c(1,1))
# Numerical calculation
data.frame(mean = mean(x),
median = median(x),
min = min(x),
max = max(x),
variance = var(x),
sd = sd(x))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.