2

What does this error mean?

Error in `[<-`(`*tmp*`, i, 1, value = 0.0225315561703551) : 
  subscript out of bounds
mstats
  • 29
  • 1

1 Answers1

1

This error code means you are trying to index your variable outside its range. Example so if you had an array x <- c(1,2,3) and you were wanted x[4], or tried to call x[3.14].

  1. Check your code, To debug in Rstudio, I put browser() statements in where I want code to stop and then step through the process.

  2. Check how you are indexing any loops. I noticed it is complaining about i

  3. Update your package you are using for calc. You can sometimes run into gremlins that have been fixed in later versions.

  4. This may be helpful: Subscript out of bounds - general definition and solution?

Community
  • 1
  • 1
micstr
  • 5,080
  • 8
  • 48
  • 76