Getting data into the right format is a frustration I have with R:

> arrayQualityMetrics(expressionset = eset,outdir = "ArrayQualityMetrics",intgroup = c("sample_type_2.0"),do.logtransform=TRUE)
The directory 'ArrayQualityMetrics' has been created.
Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) :
undefined columns selected

I’ve run into this problem before and manage to forget from time to time. From this post (, remembered that data cannot be a data frame class, instead a matrix class. I still don’t understand the difference between matrix and data frame in R. Sometimes certain functions complain if data are in one class vs. another so you just have to figure out which is best for what you’re doing and convert between the two when necessary.

Switch from data frame to matrix and back again with:


For the Bioconductor, limma package with the ExpressionSet container, the featureData (annotations) and phenoData (sample info) objects must be data frames, while the assayData “exprs” must be a matrix.


About Lisa Johnson

PhD candidate at UC Davis in Molecular, Cellular, and Integrative Physiology
This entry was posted in limma, Microarray, R. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s