[R] R - problem with my loops which operate on raster data
mateokkk
vkedzior at is.pw.edu.pl
Thu May 5 06:21:36 CEST 2011
library(rgdal)
my_asc=dir("~/Pulpit/dods/karol/TVDI
113_121",pattern=".asc",recursive=T,full.names=T)
for (i in 1:length(my_asc))
{
r <- readGDAL(my_asc[i])
z <- as.matrix(r)
vectordata[i] <- mean(z)
vectordatamax[i] <- max(z)
vectordatamin[i] <- min(z)
vectordev[i] <- sd(z,na.rm=True)
hist(z)
png(filename="hist"+tostring(i)+".png")
}
<li>I try to do some modyfication of this loop, but it still doesn't works -
which fragment is incorrect?
<li>I would like also to use more complicated pattern (to list only files
which contains on the end of it name two numbers), but adding something
like:
pattern="_??.asc" seems not works.
<li>I would like to add one more loop to get list of folders (instead of
manually inserting directories into my_asc variable), but I haven't got Idea
how I can do it?
<li>I do not know, why my way of creating vectors for mean, max, min and
standard deviation values is not working...
--
View this message in context: http://r.789695.n4.nabble.com/R-problem-with-my-loops-which-operate-on-raster-data-tp3497533p3497533.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list