Re: [R] <no subject>

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Thu 15 Dec 2005 - 22:32:49 EST

On 12/14/05 9:14 PM, "Marco Blanchette" <mblanche@berkeley.edu> wrote:

> Dear all,
>
> I am still fairly new to R and try to analyze large tables of data generated
> from genomic experiment. Currently, I am trying to plot pair of experiments
> coming from different file, trying to look at the behavior of individual
> feature in pair of experiment.
>
> My problem is that I have independent list from different source and I would
> like to plot the pair of value using a common key. As in this simplified
> version:
>
> table1 = list(CGID=c("CG_1","CG_3","CG_2", "CG_4", "CG_5"),
> diff=c(3,5,6,4,3))
>
> table2 = list(CGID=c("CG_2","CG_3","CG_4", "CG_1", "CG_5"),
> diff=c(4,6,3,9,10))
>
> How can link the two table trough the CGIDC column and plot the data from
> the 2 tables.

 table1 <- data.frame( CGID=c("CG_1","CG_3","CG_2", "CG_4", "CG_5"), diff=c(3,5,6,4,3))

 table2 <- data.frame( CGID=c("CG_2","CG_3","CG_4", "CG_1", "CG_5"), diff=c(4,6,3,9,10))

 table.merged <- merge(table1,table2,by.x=1,by.y=1)

In other words, use a data.frame here and then use merge.

Does that do it?

Sean



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 Dec 15 22:47:02 2005

This archive was generated by hypermail 2.1.8 : Thu 15 Dec 2005 - 23:42:03 EST