I am receiving the error "Error in x[i, ] : subscript out of bounds
while using the TukeyC
library for R.
I am attempting to run an ANOVA followed by the Tukey HSD post-hoc test. The code (below) works fine for my initial dataset richORIG
.
library(TukeyC)
avORIG <- with(richORIG, aov(rich ~ ClimDiv_ORIG, data=richORIG))
summary(avORIG)
tkORIG <- TukeyC(x=avORIG, which='ClimDiv_ORIG')
summary(tkORIG)
plot(tkORIG)
Resulting in:
avORIG <- with(richORIG, aov(rich ~ ClimDiv_ORIG, data=richORIG))
> summary(avORIG)
Df Sum Sq Mean Sq F value Pr(>F)
ClimDiv_ORIG 8 488.7 61.09 76.17 <2e-16 ***
Residuals 1413 1133.2 0.80
> tkORIG <- TukeyC(x=avORIG, which='ClimDiv_ORIG')
trace: TukeyC(x = avORIG, which = "ClimDiv_ORIG")
> summary(tkORIG)
Goups of means at sig.level = 0.05
Means G1 G2 G3 G4 G5
12 5.10 a
23 4.70 b
11 4.68 b
22 4.50 b
13 4.24 c
21 4.03 c
33 3.26 d
32 3.14 d
31 2.38 e
> plot(tkORIG) ##I can't post the picture of the plot w/o appropriate reputation
I try this again with my rich2080
dataset
av2080 <- with(rich2080, aov(rich ~ ClimDiv_2080, data=rich2080))
summary(av2080)
tk2080 <- TukeyC(x=av2080, which='ClimDiv_2080')
summary(tk2080)
plot(tk2080)
But get the error below
> av2080 <- with(rich2080, aov(richtimestep ~ ClimDiv_2080, data=rich2080))
> summary(av2080)
Df Sum Sq Mean Sq F value Pr(>F)
ClimDiv_2080 8 16.2 2.0264 7.574 5.97e-10
Residuals 1416 378.9 0.2676
> tk2080 <- TukeyC(x=av2080, which='ClimDiv_2080')
trace: TukeyC(x = av2080, which = "ClimDiv_2080")
Error in x[i, ] : subscript out of bounds
The code works for all of my other data-sets (ex: simpORIG, simp2080, shanORIG, shan2080
etc.)
I came across this StackOverflow Q/A in reference to my question, but I cannot figure out what code to change in my particular circumstance.
Here are the options available from the debug menu, but as I sift through the ls()
, I don't know which value to change...
Enter a frame number, or 0 to exit
1: TukeyC(x = av2080, which = "ClimDiv_2080")
2: TukeyC.aov(x = av2080, which = "ClimDiv_2080")
3: make.TukeyC.test(r = r, MSE = MSE, m.inf = m.inf, ord = ord, sig.level
4: make.TukeyC.groups(dif)
How would I go about fixing this error to get my results?