Displaying 1 result from an estimated 1 matches for "outmat88".
Did you mean:
outmat
2005 Jun 10
2
Replacing for loop with tapply!?
...ns
across the globe (15000 stations).
For each station, we need to calculate the number of days a certain
temperature is exceeded.
So far we used the following S code, where mat88 is a matrix containing
rows of 365 daily temperatures for each of 15000 weather stations:
m <- 37
n <- 2
outmat88 <- matrix(0, ncol = 4, nrow = nrow(mat88))
for(i in 1:nrow(mat88)) {
# i <- 3
row1 <- as.data.frame(df88[i, ])
temprow37 <- select.rows(row1, row1 > m)
temprow39 <- select.rows(row1, row1 > m + n)
temprow41 <- select.rows(row1, row1 > m + 2 * n)
outmat88[i,...