I use ggplot to use multiple plots, so I built my own function.
plothist <- function(a) {
ggplot(aes(x = a), data = data) + geom_histogram()
}
p1 <- plothist(data$fixed.acidity)
p2 <- plothist(data$volatile.acidity)
p3 <- plothist(data$citric.acid)
p4 <- plothist(data$residual.sugar)
p5 <- plothist(data$chlorides)
p6 <- plothist(data$free.sulfur.dioxide)
p7 <- plothist(data$total.sulfur.dioxide)
p8 <- plothist(data$density)
p9 <- plothist(data$pH)
p10 <- plothist(data$sulphates)
p11 <- plothist(data$alcohol)
x <- grid.arrange(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11,
top = "Histogram of independent variables")
x
the x-axis does not have the name of the variable, I only can see "a" on every plot, which makes the plots pretty useless. Can you help me how to display the actual variable there?