View Single Post
Old 10-04-2011, 07:42 PM   #5
byou678
Member
 
Location: Maryland

Join Date: Aug 2011
Posts: 52
Thumbs up

Thanks again ECO. Yes, I like using R too and I have figured it out.

Quote:
Originally Posted by ECO View Post
Just need to tell merge what to do...(note I added two extra genes into df1)

Code:
> df1
  Gene Change    Padj
1    1    212 0.00060
2    2     99 0.09000
3    3     15 0.70000
4    4     59 0.45600
5    5    418 0.00001
6    6    566 0.00000
7    7    123 0.00000
8    8    125 0.04000
> df2
  Gene Statistic    FDR
1    1        28 0.0005
2    2        17 0.0070
3    3         3 0.8100
4    4         8 0.2800
5    5        48 0.0020
6    6       111 0.0000
> merge(df1,df2,on=Gene)
  Gene Statistic    FDR Change    Padj
1    1        28 0.0005    212 0.00060
2    2        17 0.0070     99 0.09000
3    3         3 0.8100     15 0.70000
4    4         8 0.2800     59 0.45600
5    5        48 0.0020    418 0.00001
6    6       111 0.0000    566 0.00000
edit: Looks like "on" isn't necessary...something else going on with your data? Merge is pretty smart by default...
byou678 is offline   Reply With Quote