Skip to content
Prev 243700 / 398502 Next

attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

Cheers Bill.

You got me halfway, since:

 > temp <- merge(x=x, y=y[,17, drop=FALSE], by="rownames", sort=FALSE)
Error in fix.by(by.x, x) : 'by' must specify valid column(s)

but, using "row.names" instead of "rownames", like:
 > temp <- merge(x=x, y=y[,17, drop=FALSE], by="row.names", sort=FALSE)

works (but adds a column "Row.names").

Which seems some what counter intuitive to me since i am feeding in two 
matrices to the merge function, which i understand have 'rownames', not 
'row.names' as data frames have, right? Although the output of merge() 
is a data frame...

thanks again,

Karl
On 12/1/2010 6:08 PM, William Dunlap wrote: