0

Eset is an expression matrix and I'm trying to make a PCA and I keep on getting this error and I was thinking maybe it was because "exprs" is not numeric but I'm checking and it is double. how can I solve this?

Eset<-ExpressionSet(as.matrix(exp))
pData(Eset)<-meta
featureData(Eset) <- as(feat,"AnnotatedDataFrame")

exprs<- Biobase::exprs(Eset)
exprs<-t(exprs)
exprs<- as.numeric(exprs)
type(exprs)
PCA <- prcomp(exprs, scale = FALSE)

I was not expecting this error because I made sure that "exprs" was numeric but it's still not working

N Tmz
  • 1
  • 1
  • Welcome to StackOverflow. Please make your post [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by providing your data and any `library()` calls within yuour question. – jrcalabrese Dec 06 '22 at 18:25
  • For starters try `which(is.na(iris.sub), arr.ind=TRUE)` to see if there are any missing values and `which(is.infinite(as.matrix(iris.sub)), arr.ind=TRUE)` to see if there are any infinite values. The `na.action=` argument in `prcomp` controls how to handle missing data and the default is `na.fail`. – dcarlson Dec 06 '22 at 19:00

0 Answers0