[R] How to calculate the spatial correlation of several files?

Rui Barradas ruipbarradas at sapo.pt
Mon Dec 3 17:39:13 CET 2012


Ok, so I was mistaken when I thought I had made a mistake. Change to 
"rows" again:

for (.f in seq_along(dir1)){
     results[[.f]]<- cor(file1[.f, ] ,file2[.f, ])
}


Rui Barradas
Em 03-12-2012 16:26, Jonsson escreveu:
> Thanks
> you meant it shoud be:
> file1=do.call(rbind, lapply(dir1, readBin, integer(), size = 2, n = 360 *
> 720,
>                        signed = T))
> file2=do.call(rbind, lapply(dir2, readBin, integer(), size = 2, n = 360 *
> 720,
>                        signed = T))
> Please see the error
>> for (.f in seq_along(dir1)){
> +   results[[.f]]<- cor(file1[, .f] ,file2[, .f])
> + }
> Error in file2[, .f] : incorrect number of dimensions
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-the-spatial-correlation-of-several-files-tp4651888p4651901.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list