On Tue, 6 Nov 2007, Diogo Alagador wrote: > Hi all, > > Basically I have 2 data frames with equal dimension and I want to apply > the wilcox.test to compare columns in the same position (i.e. 1st of > df.A with 1st of df.B, 2nd of df.A with 2nd of df.B,...). Anyone give me > an hint on this, as I think it is nicer to avoid loops, specially for > huge dataframes (30000 x 200)
Avoiding loops is unlikely to help with speed. It is more likely to be useful to avoid large dataframes (using lists or matrices) but you may need the dataframe structure for something else. If you really want to avoid loops because it is nicer you could use mapply(): mapply(wilcox.test, df.A, df.B) but this might be slower than a loop. -thomas ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.