我试图弄清楚如何自定义plot.CLD
函数在emmeans
. plot 函数会生成一个不错的默认绘图,但它似乎不共享plot.cld
. 此外,我找不到任何文档plot.CLD
,只有plot.cld
. 我特别想将紧凑型字母显示添加为绘图上的数据标签。我还想切换 xvar 和 yvar 变量来旋转绘图。
我正在lmer
对一些体重数据运行混合效应模型。我想计算和绘制 tukey 调整emmeans
输出的紧凑型字母显示。函数 cld 是为glht
-type 数据设计的,可以使用plot.cld
. 该cld
功能在emmeans
包中作为CLD
.
该plot.CLD
功能处于活动状态,但未在emmeans
包中记录。的定制plot.cld
已记录在案,但没有类似的文档plot.CLD
可用。我尝试plot.cld
了我的emmeans
对象,但它不兼容。我能够修改的唯一功能是xlab=
and ylab=
。奇怪plot.CLD
的是,需要包multcompView
,但没有关于该功能的文档。
library(lme4)
library(lmerTest)
library(multcomp)
library(multcompView)
#Generating means
attach(dataX)
x = lmer(plant_kg_cum2~ (genotype) + (1|rep) )
emmeans(x, list(pairwise~genotype), adjust="tukey", ddf="Satterthwaite", level = 0.95)->emmeans1
#producing compact letter display
cld(emmeans1, sort=FALSE, Letters=c("ABCDEFGHIJKL",LETTERS, letters), which=1) ->CLD1
#plot the compact letter display
plot(CLD1, xlab="kg", ylab="Genotype")
我什至尝试使用添加标题main="title"
,但即使这样也不成功。x=
我尝试在我的数据框中切换 xvar 和 yvar 以通过更改列顺序或使用andy=
命令来重新定位绘图。所有人都给出了错误,说它产生了 NA。