i open raster files (in ascii or tiff format), aggregate cells , after operation count correlation between values in new raster file , one. unfortunately not know wrong in commands - error message:
x <- gdal.open('~/pulpit/dods/karol/tvdi 113_121/tvdi_kamp_evi_transf.asc')
cpl error 4: `~/pulpit/dods/karol/tvdi 113_121/tvdi_kamp_evi_transf.asc' not exist in file system, , not recognised supported dataset name.
error in .local(.object, ...) : `~/pulpit/dods/karol/tvdi 113_121/tvdi_kamp_evi_transf.asc' not exist in file system, , not recognised supported dataset name.
if having trouble getting filenames, might this:
my_asc_files = dir("../somepath", pattern="*.asc", recursive=t, full.names=t) files_i_want = my_asc_files[c(1,12,32,33)]
then can load files this
library(raster) my_rasters = lapply(files_i_want, raster)
then may this:
pairs(my_rasters)
and this:
for(i in 1:length(my_rasters)) for(j in i:length(my_rasters)) if(i != j) { df = na.omit(data.frame(values(my_rasters[[i]]), values(my_rasters[[j]]))) cor(df[,1], df[,2]) }
although run problems if rasters large cannot hold 2 in memory @ same time. without better question hard give better advice.
Comments
Post a Comment