mult.explorer = function(x, y) { x11() par(mfrow = c(1,2), mar = c(4,4,2,2)) if(class(x) != "numeric" | class(y) != "numeric") {stop("x and y must be numeric")} if(length(x)!=length(y)) {stop("x and y must have the same length")} boxplot(x, xlab = "Variavel x") boxplot(y, xlab = "Variavel y") sumario.x = summary(x) sumario.y = summary(y) sumario = list(Var.x = sumario.x, Var.y = sumario.y) corr = list(coef.corr = cor(x, y)) return(list = c(sumario, corr)) } a = rnorm(100, 10, 5) b = rnorm(100, 5, 2.5) mult.explorer(a, b)