[R] How to stop function printing unwanted output?

2009-08-06 Thread Tymek W
Hi, I want to use an output of one function (LSD.test) in other. How is it that while saving output from LSD.test to variable, it prints own output out? The function could be simplified to: fun <- function ( ... ) { ... lsd <- LSD.test(data[1], data[2], df, mse) ... } In my example,

Re: [R] Strange t-test error: "grouping factor must have exactly 2 levels" while it does...

2009-07-10 Thread Tymek W
v in 1:ncol(data)) { if (nam[v] != g) { res[v] <- list(t.test(data[[nam[v]]]~data[[g]])) }} res } What is going wrong here? Greetz, Timo 2009/7/10 Marc Schwartz : > On Jul 9, 2009, at 5:04 PM, Tymek W wrote: > >> Hi, >>

[R] Strange t-test error: "grouping factor must have exactly 2 levels" while it does...

2009-07-09 Thread Tymek W
Hi, Could anyone tell me what is wrong: > length(unique(mydata$myvariable)) [1] 2 > and in t-test: (...) Error in t.test.formula(othervariable ~ myvariable, mydata) : grouping factor must have exactly 2 levels > I re-checked the code and still don't get what is wrong. Moreover, there is som