Re: [R] using functions with multiple arguments in the "apply" family

2010-08-11 Thread casalott
I can actually answer this!! I was trying to figure out how to use sapply for a function I wrote with multiple arguments. Suppose the function is called FUN(a,b), where "a" is a number and "b" is a number You can use mapply(FUN, a = VECTOR, b = VECTOR) where each vector is your input arguments.

Re: [R] using functions with multiple arguments in the "apply" family

2010-01-28 Thread Peter Ehlers
chipmaney wrote: typically, the apply family wants you to use vectors to run functions on. However, I have a function, kruskal.test, that requires 2 arguments. kruskal.test(Herb.df$Score,Herb.df$Year) This easily computes the KW ANOVA statistic for any difference across years However, my

[R] using functions with multiple arguments in the "apply" family

2010-01-27 Thread chipmaney
typically, the apply family wants you to use vectors to run functions on. However, I have a function, kruskal.test, that requires 2 arguments. kruskal.test(Herb.df$Score,Herb.df$Year) This easily computes the KW ANOVA statistic for any difference across years However, my data has multiple