[R] R: looping

Clark Allan Allan at STATS.uct.ac.za
Fri May 20 16:00:37 CEST 2005

hi all

i have a simple question. code is displayed below. 

how can i use a vectorised command in order to do this (ie replace the
loop)? (ie apply, lapply, sweep, etc)


for (i in 1:3)	z[z[,i]>top[i]]<-top[i]

More information about the R-help mailing list