0
results2 <- list()

for (j in c(1:14)) {
  for (i in c(1:14)) {
    results2[["SS"]][[j]][[i]] <- list(which(Diff11[,j] == 0 & Diff22[,i] == 0, arr.ind =TRUE))
  }
}

why it gives me Error in *tmp*[[j]] : subscript out of bounds, when both Diff11 and Diff22 are tbl_df with 14 columns?

John Coleman
  • 51,337
  • 7
  • 54
  • 119
  • 1
    Something is out of bounds. Just what and why is hard to say -- since we don't know what your data structures actually are. Please provide a [mcve]. See [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269/4996248) for what this would mean in R. – John Coleman Mar 04 '21 at 19:35
  • Well Diff11 and Diff22 have been generated within the same loop. They are tables containing 14 columns and approximately 2 millions smtg rows. The puzzling thing is that to generate Diff11 and Diff2 I proceeded the same way , a part from the fact I have only used i (didnt need j in that case). Then from the list created by the loop i have extracted the values for Diff11 and Diff22. To make point clear, each cells in Diff11 and Diff22 is a number since it is the results of a simple subtraction – Ruggiero Rippo Mar 04 '21 at 20:51

0 Answers0