I tend to apply t-test for each row in my data frame, which is the microarray data, comparing columns 2:13 and 14:67 by these code:
t_test = apply(Df, 1, function(x) { t.test(x[2:13], x[14:67])$p.value } )
However, I got this error:
Error in if (stderr < 10 * .Machine$double.eps * max(abs(mx), abs(my))) stop("data are essentially constant") : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In mean.default(x) : argument is not numeric or logical: returning NA 2: In mean.default(y) :
I have checked if any value is missing/non-numeric or not by some advice about these issues (it seems like many people got this issue as well) by this code:
TRUE %in% is.character(Data_rma[2:13]) TRUE %in% is.character(Data_rma[14:67])
TRUE %in% is.na(Data_rma[2:13]) TRUE %in% is.na(Data_rma[14:67])
Nothing is missing and all the values are numeric. I don't know what's the problem with my issue.
Thank you very much!
I have uploaded my Data frame to Drive so you can try it. https://drive.google.com/file/d/1FE81HYaSTo7rEPG-qb-mdknPcpvebsWT/view?usp=sharing