Bing Cui
Bing Cui

Reputation: 45

Error in R lsmeans() function: Error in format.default(nm[j], width = nchar(m[1, j]), just = "left")

I'm trying to find the least square mean of "post" by "group". Values of "group" are "TEST" or "CONTROL".

mixed_data <- data.frame(group, pre, post)
mixed_lm <- lm(post ~ group + pre, data=mixed_data)
mixed_lsmean <- lsmeans(mixed_lm, "group")

But I received this error and don't understand why:

Error in format.default(nm[j], width = nchar(m[1, j]), just = "left") :
4 arguments passed to .Internal(nchar) which requires 3

Any idea?

Upvotes: 2

Views: 558

Answers (1)

Russ Lenth
Russ Lenth

Reputation: 6770

I experienced this issue myself just now on a new laptop. I initially installed R 3.2.0 on it, as I had the binary on a thumb drive. Then, after installing lsmeans, I observed the same error when running example(lsmeans). But then I installed R 3.2.1, and everything worked fine. So, my guess is that you have R 3.2.0 or earlier.

Upvotes: 1

Related Questions