I have R script as shown below and has error
areaw=matrix(0,nrow=2592,ncol = 1647)
dim(areaw)
[1] 2592 1647
#
areaw[,1]=temp[,1]
areaw[,2]=temp[,2]
#
dim(temp)
[1] 2592 2
#
for(j in 3:1647) {for (i in 1:2592) {if(temp[i,j]> -290.0) {areaw[i,j]=veca[i]} }}
Error in temp[i, j] : subscript out of bounds
then How can I fix the subscript out of bounds error? Thank you very much in advance for your time