Re: [R] Passing arguments to with()

2009-07-08 Thread Duncan Murdoch
On 08/07/2009 10:01 AM, Tymek Wo?odz'ko wrote: Hi, I've been wondering how to write a function that will produce results from multiple tests (eg. paired t-tests) for all or several variables in some data frame. I'd like it to do t-test for each variable ('x') in 'data' by 'y'. I'm stuck in here:

[R] Passing arguments to with()

2009-07-08 Thread Tymek Wołodźko
Hi, I've been wondering how to write a function that will produce results from multiple tests (eg. paired t-tests) for all or several variables in some data frame. I'd like it to do t-test for each variable ('x') in 'data' by 'y'. I'm stuck in here: function(data,y) { for (x in names(data)) {