[R] R - Array data loop selection
dengyu19901102
a1204342 at student.adelaide.edu.au
Mon Feb 6 00:21:51 CET 2012
Don't worry, i have figured it out. I forgot the most basic method by adding
another increasing loop counter.
k=0
for (yr in 1982:2010) {
temp <- ssta_sst[,,year_sst==yr & (month_sst>=6 & month_sst<=8)]
k=k+1
for (i in 1:360) {
for (j in 1:180) {
ssta_winter[i,j,k] <- mean(temp[i,j,])
}
}
}
--
View this message in context: http://r.789695.n4.nabble.com/R-Array-data-loop-selection-tp4358282p4360028.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list