Re: [R] strange error msg from lapply and lm()

2010-05-03 Thread weix1

plus, it took long time to complete this analysis for only 24 records!
Although I get the error msg, the result seems to be correct.


-- 
View this message in context: 
http://r.789695.n4.nabble.com/strange-error-msg-from-lapply-and-lm-tp2124042p2124050.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


[R] strange error msg from lapply and lm()

2010-05-03 Thread weix1

I am conducting a very simple t test for two genes using lapply (i try to
avoid loop since i will have thousands of genes later on). however, I got
strange error msg like the followings. It looks that R is complaining my
factor has only one level, which is not the case (I check many times).

 result- lapply(split(all,all$CHIPEXP_NAME),function(x)
 lm(logvalue~treatment,x))
Error in `contrasts-`(`*tmp*`, value = contr.treatment) : 
  contrasts can be applied only to factors with 2 or more levels


can anyone help me to dissect this problem?

thanks in advance.


-- 
View this message in context: 
http://r.789695.n4.nabble.com/strange-error-msg-from-lapply-and-lm-tp2124042p2124042.html
Sent from the R help mailing list archive at Nabble.com.

__
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.