Closed Easonchen12 closed 1 year ago
The generic for cld
is in the multcomp package. I think it will work if you do multcomp::cld(m1.emmeans,Letters=letters)
.
If not, then I think there is some issue with method registration. Is emmeans actually loaded? It will probably get straightened-out by unloading and reloading one of the packages, or by restarting R.
I can add that in my experience[^1], this resolves the issue in most cases:
{emmeans}
, {multcomp}
and {multcompView}
{emmeans}
, {multcomp}
and {multcompView}
[^1]: My experience being people in R workshops who had never used cld()
before and are seeing the error when trying it for the first time. There is always at least one person per workshop with this error; these steps usually resolve it.
@SchmidtPaul Thanks. I know I have seen this kind of error reported before, but hadn't tracked where or how to fix it. Having the generic for an S3 method outside of one of the basic packages, and not in the package where a method resides, is one of those pathological situations...
I think this is resolved, so am closing this issue.
I used the 1.8.5 version of the "emmeans" package. My R version is 4.2.2
My mixed-liner model
m1<-lmer(Respone~A*B+(1|C), data = DATA) # The A is Categorical variable, The B is continuous variable. m1.emmeans<-emmeans(m1,"A",data=DATA,var="B") m1.emmeans pairs(m1.emmeans) cld(m1.emmeans,Letters=letters)
when i run,it showed
Error in UseMethod("cld") : no applicable method for 'cld' applied to an object of class "emmGrid"
Can you help me with that?