Re: [R] how can I write two objects together, problem with cbind( )

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Thu 16 Feb 2006 - 11:43:03 EST


See ?merge.

Andy

From: Srinivas Iyyer
>
> Hi Group,
> I have two objects
> 1. A data.frame with 2 columns
>
> Apple 4
> Boy 2
> Cat 5
> Dog 10
> Eel 9
> ...
> Zebra 10
> (26 rows)
>
> I have another object which was obtained as vector of
> integers with names as character.
>
> Fruit 10
> King 20
> Eel 19
> Boy 20
> Apple 15
> ...
> (26 rows)
>
> Now I wanted to combine the two objects and wanted a
> result that would look like this:
>
> Apple 4 15
> Boy 2 20
> Cat 5 28
> Dog 10 25
> Eel 9 19
>
>
> result <- cbind(obj1, obj2)
>
> My result is now jumbled:
>
> Apple 4 34
> Boy 2 21
> Cat 5 234
> Dog 10 23
> Eel 9 12
>
> I want to write identical row names elements together.
>
>
> What could be done here. Could any one please help me.
>
>
> thanks
> Srini
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Feb 16 11:49:37 2006

This archive was generated by hypermail 2.1.8 : Thu 16 Feb 2006 - 16:34:56 EST