Skip to content

merge

3 messages · elyakhlifi mustapha, PIKAL Petr, Mike Meredith

#
r-help-bounces at stat.math.ethz.ch napsal dne 20.06.2007 18:02:07:
true
good display.
I may be mistaken but in such a case do you really want to do merge? Or 
just connecting both objects (data.frames) to list will do what you want?

In case you want:

pred
        Rep1...
Var1

obs
        Rep1...
Var1

in one object I think list is what I will go for.

In case you want:

state   var  Rep1 Rep2....
pred    Var1
obs     Var1
pred    Var2
obs     Var2

I would try to fiddle with merge after adding a column state to each 
object (I hesitate to call it data frame due to "supernames")

Regards
Petr
_____________________________________________________________________________
Mail
http://www.R-project.org/posting-guide.html
#
Looking at the data, maybe what you need is an array:

array(c(A, B), c(5,6,2), dimnames=list(rownames(A),
    colnames(A), c("obs","pred")))

This allows you to keep the names and 'supernames'.

This will work if A and B are matrices, not data frames, so you may have to
use 'as.matrix' first.

HTH, Mike.
elyakhlifi mustapha wrote: