I have found another way, much simpler employing library(ggExtra) for creating Marginal Histogram / Boxplot with simple commands:
ggMarginal(p1, type = "histogram", fill="transparent")
ggMarginal(p1, type = "boxplot", fill="transparent")
ggMarginal(p1, type = "density", fill="transparent")