TukeyHSD test error: number of items to replace is not a multiple of replacement length

Viewed 16

I have a data whose summary is like below. I applied ANOVA and then TukeyHSD test in RStudio as below:

summary(Hb2$SamplingMethod)
Samp_aov <-aov(D~ SamplingMethod, weights=S, data=Hb2)
summary(Samp_aov)
TukeyHSD(Samp_aov)

The output is:

> summary(Hb2$SamplingMethod)
        Fecal Fecal+Observation     Fecal+Stomach       Observation           Stomach 
          542                 0                 0               217               359 
 > Samp_aov <-aov(D~ SamplingMethod, weights=S, data=Hb2)


> summary(Samp_aov)
                  Df Sum Sq Mean Sq F value   Pr(>F) 
SamplingMethod   2   0.55 0.27518   15.26 2.99e-07 ***
Residuals      956  17.24 0.01803      
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1



 > TukeyHSD(Samp_aov)
 > Error in result[, i] <- prj[, select, drop = FALSE] %*% rep.int(1, df[i]) : 
number of items to replace is not a multiple of replacement length

I tried dput() function but it does not work. What can be the cause of this error?

0 Answers
Related