0

我想为以下晶格图形添加两个等价图。plot()我对该函数的常用技巧par(mfcol=c(1,2))不适用于这些基于格的图。尽管我似乎无法从解决方案中提取所需的信息,但我查看了相关帖子。如何组合以下等价图,使它们在输出中彼此相邻(并排)?或者,换句话说,晶格等价于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)
4

1 回答 1

1

从@mplourde 评论中的链接,对代码的以下更改将图表排列到我的规范中:

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))

在此处输入图像描述

于 2012-10-30T17:55:01.823 回答