Skip to content
Prev 294179 / 398503 Next

Interweaving of two datasets

Hello,

What doesn't work, exactly?
I can only see two things:

1. The order of the columns is different, first data.frame in merge
instruction comes first.
    Solution: reverse the order of data.frames in merge.
2. The order of the rows is different, the merge function orders it's output
by the common col(s).
    Solutions: leave as is or use 'order'.

# first is the first sheet in attached .xls file, second is the second and
result is the third.
# 1.
res2 <- merge(second, first)

# 2.
result[order(result$name, result$request), ]
res2[order(res2$name, res2$request), ]

If this isn't it, please state what the problem is,  "doesn't work" is a bit
vague.

Hope this helps,

Rui Barradas



lunarossa wrote
--
View this message in context: http://r.789695.n4.nabble.com/Interweaving-of-two-datasets-tp4608505p4623624.html
Sent from the R help mailing list archive at Nabble.com.