pred=data.frame(seq(1,100,by=2))
obs=data.frame(seq(1,100,by=3))
pr=data.frame(seq(1,200,by=4))
for (i in 1:dim(pred)[2]) {
if (pr[,i]>max(pred[,i],na.rm=T)){
pr[,i]=pr[,i]*(max(obs[,i],na.rm=T)/max(pred[,i],na.rm=T))}}
I am getting error"the condition has length > 1 and only the first element will be used" any alternatives??
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…