[R] R - problem with my loops which operate on raster data

From: mateokkk <vkedzior_at_is.pw.edu.pl>
Date: Wed, 04 May 2011 21:21:36 -0700 (PDT)


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.

______________________________________________
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.
Received on Thu 05 May 2011 - 07:11:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 May 2011 - 09:10:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive