1
    while (x < as.numeric(s_max)){
      len2<-length(subdata2)
      resize<-approx(seq_along(subdata2), subdata2, n = len2*x)$y
      len<-length(resize)
      initial<-(length(subdata1)*(scale))+step
      for (i in initial){
          testdata3<-testdata1[(i):(len+(i))]
          corl<-cor(testdata3, resize, use = "na.or.complete")
           if(corl > corr) {
            maxes<-c(corl, (len/len2), i)
            write.table(maxes,"a.txt", append = TRUE, quote = FALSE, row.names = FALSE, col.names = FALSE)

            }
          }
      x<-(x+0.01)
      setTxtProgressBar(pb, x)
    }

I get incompatible dimension on my correlation test which is strange since testdata3<-testdata1[(i):(len+(i))] and I am comparing testdata3 to resize its length being equal to len so they should both be the same length. I have gone astray trying to solve this. Any help will be greatly appreciated.

The dimensions I get is 446 vs. 445

  • Make sure to provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data. We have no idea what's really in any of these variables. – MrFlick Apr 01 '17 at 05:16

0 Answers0