Hi Dimtris and esteemed useRs,

I don't understand why i get this error message when attempting to use merge() -

> temp <- merge(x, y[,17, drop=FALSE], by=rownames, sort=FALSE)
Error in as.vector(x, mode) :
  cannot coerce type 'closure' to vector of type 'any'

It should work because:

> all(rownames(x[order(rownames(x)),]) ==
+ rownames(y[order(rownames(y[,17, drop=FALSE])),17, drop=FALSE]) .... [TRUNCATED]
[1] TRUE

also:

> class(x); class(y[,17, drop=FALSE])
[1] "matrix"
[1] "matrix"


Any idea why i cant use merge() in the normal way here? I'm forced to add the column using:

temp.b <- cbind(x, y[match(rownames(x), rownames(y)),17])

All insights appreciated for this leaRner,

cheers,

Karl


--
Karl Brand <k.br...@erasmusmc.nl>
Department of Genetics
Erasmus MC
Dr Molewaterplein 50
3015 GE Rotterdam
P +31 (0)10 704 3211 | F +31 (0)10 704 4743 | M +31 (0)642 777 268

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to