Error in as.vector (y) but the same codes work on a different computer

Hi everyone, I'm new to R.
I'm trying to conduct a pairwise comparison using emmeans for a random intercept model with covariate. My codes ran smoothly on my work laptop (Mac). No error message, everything is fine. When I ran the same exact codes on my home computer (also Mac), all of a sudden, I get the following error message for the codes below:

emm1 <- emmeans(object = lm4re,
specs = ~ Group,
ref_grid(object = lm4re,
at = list(Pretest = mean(dat2$Pretest))),
adjust = "tukey")
Error in as.vector(y) : no method for coercing this S4 class to a vector

What does this error mean? Also, the most perplexing issue for me is the fact that the data set and the codes are exactly the same. I thought maybe my version of R was corrupted, so I uninstalled and reinstalled the latest R version. 3.6.1 and the latest Rstudio version 1.2.5019 but that did not solve the issue. I am still getting the same error.

I tried the same codes and data set on a 3rd computer and once again, there was no error message.

emmeans() is not from base R, and has nothing to do with RStudio IDE so updating those are going to have no effect, assuming this function comes from the emmeans package, try checking that you are using the same package version in your home computer.

the emmeans() package on my work laptop is version 1.4, on my home laptop is version, on the 3rd computer is version 1.3.4

Do you think this is an issue with 1.4.3?

This seems like a development version, try installing a stable version from CRAN.

If this doesn't work, please try to provide a proper REPRoducible EXample (reprex) illustrating your issue.

I installed an older stable version from CRAN. problem solved! Thanks so much!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.