search for: tempspr

Displaying 1 result from an estimated 1 matches for "tempspr".

Did you mean: temps
2010 Sep 27
1
make changes in existing vector with the apply function?
...ome changes in a vector according to some conditions. It takes too long time however with vector length > 100000 and I guess a better way would be using the apply function. I cannot sort out how, however.  As a for/if loop: for (i in 1:length(PrH)) { if (is.finite(PrH[i]) == F & tempHER > tempSPR) {PrH[i] <- 1 } if (is.finite(PrH[i]) == F & tempHER < tempSPR) {PrH[i] <- 0 }} PrH, tempSPR and tempHER are equally long vectors.  Thanks in advance!Jonas [[alternative HTML version deleted]]