R question- how to use apply on a two variable t-test
does anyone know how to use the apply function on a two-variable t-test? i've tried everything.
apply(data[1:4],1,t.test) # works, but only one-variable
apply((data[1:4],data[5:9]),1,t.test) # syntax error
i've also tried using for:
for (i in 1:1000) t.test(data[i,1:4],data[i,5:9])
but it doesn't print anything!
t.test(data[i,1:4],data[i,5:9]) # works fine!
yes, sink() is empty.
thanks for any help.
|