### ======================================================== ### Function simpGraphsV2 ### ======================================================== ## Description: Function simpGraphs draws four graphs of a numeric vector ## and saves these in a pdf file. ## Arguments: ## x: A numeric vector ## nom: Name of the pdf file ## ## Code: simpGraphsV2 <- function(x, nom = "Grafics.pdf") { pdf(nom) par(mfrow = c(2, 2)) # The histogram hist(x, main = "Histogram of the data") # The boxplot boxplot(x, main = "Boxplot of the data") # Kernel density estimation plot(density(x, bw = 2*IQR(x, na.rm = T), na.rm = T), xlab = "x", ylab = "", main = "Kernel estimate of the density", type = "l") # QQ plot qqnorm(x) qqline(x) dev.off() }