Error in rowMeans(y$exprs, na.rm = TRUE) : 'x' must be numeric
Entering edit mode
keervanik • 0
Last seen 4 months ago

I am getting this error- "x must be numeric" when running this code. I am working on a pre processed data. The data frame is list.

#moderated t test using limma
file <- rma # Column 1 contains row-names
group <- rep(0:1, c(3,5))
library (limma)
lmFit(object, design=NULL, ndups=1, spacing=1, block=NULL, correlation, weights=NULL, method="ls", ...)
fit <- lmFit(file[-10, -1], design=group)
fit2 <- eBayes(fit)
toptableOut<- topTable(fit2, number=Inf, adjust.method="BH")$t
topTable(fit2, coef = 1, number = Inf, confint = TRUE, = "none")[,-4]
x <- cbind(file[,1],toptableOut)
write.table(x,"<filename>.txt", quote=F, row.names=FALSE, sep="\t")
limma • 431 views
Entering edit mode
Last seen 2 days ago
United States

You will need to provide more information than that. Simply providing code without context makes it impossible for anybody to help you. But if I were to take a wild guess, I imagine that your rma or file object (both bad names btw, as those are both function names as well) is a matrix, in which case everything is character since the first column contains the row names. As a simple example,

> mat <- cbind(letters, 1:26, 1:26, 1:26)
> library(limma)
> lmFit(mat[,-1])
Error in rowMeans(y$exprs, na.rm = TRUE) : 'x' must be numeric

But without more information this is just a guess. You need to provide the head of your file object, your design matrix, and the output from sessionInfo at the very least.

Login before adding your answer.

Traffic: 151 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6