Hello,

I want to arrange a pairs-plot and a simple boxplot next to each other.
A similar problem was already posted here:
http://r.789695.n4.nabble.com/combining-pairs-plot-with-other-plots-in-one-output-td3946235.html
but still I don't really know how to do it...

Here a some code lines for the single plot I want to combine in the end:

######## # Some sample data for combined plots ######## 
x1 <- rnorm(100)
x2 <- rnorm(100)
y <- rnorm(100)

df <- data.frame(x1,x2,y)

p1 <- pairs(df)
p2 <- boxplot(x1)

# layout(matrix(c(1,2), 1, 2, byrow = TRUE),widths=c(2,1))
# grid.arrange(p1,p2,nrow=1,widths=c(2,1))

I had a look in ?pairs but it seems there it is only possible to set the 
settings for the pairplot. But how to arrange these two different plots in one 
joint output? Maybe with viewports, but how to start?

Thank you,

/johannes

--

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to