page 392 in the book “Using R for Introductory Statistics”
EDA function return(values)
eda <- function(x) {
old.par <- par(no.readonly = TRUE) # see par examples
on.exit(par(old.par))
par(mfrow = c(1, 3)) # 3 graphs
hist(x, breaks = "Scott", probability = TRUE, col = "purple")
lines(density(x))
boxplot(x, horizontal = TRUE) # boxplot with 3 points
rug(x) # marked by rug
qqnorm(x) # normal probability plot
return(summary(x)) # return summary
}
eda(rnorm(100))
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -3.350 -0.541 0.029 0.146 0.904 3.170