I would like to add two equivalence plots together for the following lattice graphics. My usual trick for the plot()
function par(mfcol=c(1,2))
does not work with these lattice-based graphs. I have looked at the related posts, although I cannot seem to extract the information I need from the solutions. How can I combine the following equivalence plots so that they are adjacent (side by side) to each other in the output? Or, in other words, what is the lattice equivalent to par(mfcol=c(1,2))
?
require(equivalence)
# Simplified data for equivalence plot 1
a = c(2,4,6,8,10,12,14,16,18)
b = c(1,3,5,7,9,11,13,15,17)
mydata1 = data.frame(a,b)
equivalence.xyplot(mydata1$b ~ mydata1$a,
alpha=0.05, b0.ii=0.25, b1.ii=0.25)
# Simplified data for equivalence plot 2
x = c(1,4,8,2,3,4,6,5,9)
y = c(2,4,7,3,3,4,7,5,9)
mydata2 = data.frame(x,y)
equivalence.xyplot(mydata2$y ~ mydata2$x,
alpha=0.05, b0.ii=0.25, b1.ii=0.25)
From the link in the comments by @mplourde, the following alterations to the code arrange the graphs to my specs:
require(equivalence)
# Simplified data for equivalence plot 1
a = c(2,4,6,8,10,12,14,16,18)
b = c(1,3,5,7,9,11,13,15,17)
mydata1 = data.frame(a,b)
px1 = equivalence.xyplot(mydata1$b ~ mydata1$a,
alpha=0.05, b0.ii=0.25, b1.ii=0.25)
# Simplified data for equivalence plot 2
x = c(1,4,8,2,3,4,6,5,9)
y = c(2,4,7,3,3,4,7,5,9)
mydata2 = data.frame(x,y)
px2 = equivalence.xyplot(mydata2$y ~ mydata2$x,
alpha=0.05, b0.ii=0.25, b1.ii=0.25)
print(px1, position=c(0, 0.5, .5, 1), more=TRUE)
print(px2, position=c(0.5, 0.5, 1, 1))