I run the following lines from https://rdrr.io/cran/emmeans/f/vignettes/re-engineering-clds.Rmd#equiv-CLDs but got Error in UseMethod("cld") : no applicable method for 'cld' applied to an object of class "emmGrid"
set.seed(22.10)
mu = c(16, 15, 19, 15, 15, 17, 16) # true means
n = c(19, 15, 16, 18, 29, 2, 14) # sample sizes
foo = data.frame(trt = factor(rep(LETTERS[1:7], n)))
foo$y = rnorm(sum(n), mean = mu[as.numeric(foo$trt)], sd = 1.0)
foo.lm = lm(y ~ trt, data = foo)
foo.emm = emmeans(foo.lm, "trt")
library(multcomp)
cld(foo.emm)
Clearing cache and history, restarting R, and restarting the computer does not help.
Using
1.4.49
version ofmultcomp