[Bioc-devel] fData(x) <- gives errors for ExpressionSet objects

Gordon Smyth smyth at wehi.EDU.AU
Thu Nov 1 04:24:08 CET 2007

I've a lot trouble adding information to the featureData of 
ExpressionSet objects. Here is a small reproducible example which 
shows up one error message.

 > library(Biobase)
 > example(ExpressionSet)

 > fData(expressionSet)
NULL data frame with 500 rows
 > df <- data.frame(a=1:500,b=1:500)
 > rownames(df) <- featureNames(expressionSet)
 > eS <- expressionSet;
 > all.equal(row.names(fData(eS)),row.names(df))
[1] TRUE
 > fData(eS) <- df

This all seems good so far. I've been able to overwrite the pData() 
data.frame. But suppose I add a column first. It shouldn't make any 
difference, but now replacing the data.frame now longer works. The 
error complains about row.names, but these are still apparently correct.


 > eS <- expressionSet
 > fData(eS)$Number <- 1:500
 > all.equal(row.names(fData(eS)),row.names(df))
[1] TRUE
 > fData(eS) <- df
Error in `row.names<-.data.frame`(`*tmp*`, value = c("a", "b")) :
   invalid 'row.names' length

 > sessionInfo()
R version 2.6.0 (2007-10-03)


attached base packages:
[1] tools     stats     graphics  grDevices 
utils     datasets  methods   base

other attached packages:
[1] Biobase_1.16.0

More information about the Bioc-devel mailing list