Mohamed Lajnef wrote:
Dear All,
I apologize for this trivial question, I can not find the solution
I try to use t.test function per line in the data.frame, But i
dont'understand the error message
my program is as follows
group1<-gl(2,20)
fun<-function(x){
m<-data.frame(group1,x)
#anova(aov(x ~ group1, m))
t.est(x ~ group1,m)
}
Are you sure this is your code? What is t.est? What is m? Please
provide a reproducible example.
ttest<- apply(data, 1, fun)
Error in t.test.default(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, :
data are essentially constant
What is data?
The error is explained in the help page, which says:
If the input data are effectively constant (compared to the larger
of the two means) an error is generated.
It looks like your input data are all '1' as shown in the error message.
______________________________________________
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.