Gunther Höning
2006-Jul-21 07:33 UTC
[R] Merge two dataframes of different column length and row length by two columns at a time
Hello, I have two dataframes of the following structures: str(a) `data.frame': 1354896 obs. of 14 variables: $ V1 : int 0 1 2 3 4 5 6 7 8 9 ... $ V2 : int 0 0 0 0 0 0 0 0 0 0 ... $ V3 : int 74 12305 103 12337 46 57 12446 90 12097 79 ... $ V4 : num 11.8 1529.2 17.8 1579.4 6.7 ... $ V5 : int 88 11040 104 11557 56 58 11040 74 10991 81 ... $ V6 : num 15.5 1921.3 20.3 1888.2 12.6 ... $ V7 : int 87 8793 90 10142 67 64 9264 73 8589 71 ... $ V8 : num 16.0 1750.6 15.2 1783.7 11.0 ... $ V9 : int 68 11279 93 11831 43 61 11234 82 10919 76 ... $ V10: num 11.5 1999.5 39.0 1842.2 5.0 ... $ V11: int 110 12456 92 12063 60 59 12393 82 11831 77 ... $ V12: num 21.4 1974.7 33.9 1689.9 10.6 ... $ V13: int 81 10887 101 10874 62 74 11115 79 10789 93 ... $ V14: num 19.5 1812.3 31.7 1524.1 11.9 ...> str(b)`data.frame': 1213901 obs. of 4 variables: $ V1: int 0 1 2 3 5 6 7 8 9 10 ... $ V2: int 0 0 0 0 0 0 0 0 0 0 ... $ V3: Factor w/ 54676 levels "str23","str53",..: 54676 54676 54676 54676 54676 54676 54676 54676 54676 54676 ... $ V4: Factor w/ 3 levels "Match","NoMatch",..: 2 2 2 2 2 2 2 2 2 2 ...>I want to merge these dataframes by V1 and V2 of a and b. The combination of V1, V2 is a unique key. Note that b is smaller than a. Any suggestions to solve this problem ? Gunther H?ning Diplom Physiker Bioinformatiker Langenbeckstra?e1 55131 Mainz gunther.hoening at ukmainz.de
Philipp Pagel
2006-Jul-21 08:24 UTC
[R] Merge two dataframes of different column length and row length by two columns at a time
On Fri, Jul 21, 2006 at 09:33:56AM +0200, Gunther H?ning wrote:> I have two dataframes of the following structures:[...]> I want to merge these dataframes by V1 and V2 of a and b. The combination of > V1, V2 is a unique key. > Note that b is smaller than a. > > Any suggestions to solve this problem ?Use merge() cu Philipp -- Dr. Philipp Pagel Tel. +49-8161-71 2131 Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186 Technical University of Munich Science Center Weihenstephan 85350 Freising, Germany and Institute for Bioinformatics / MIPS Tel. +49-89-3187 3675 GSF - National Research Center Fax. +49-89-3187 3585 for Environment and Health Ingolst?dter Landstrasse 1 85764 Neuherberg, Germany http://mips.gsf.de/staff/pagel
Seemingly Similar Threads
- why this function give error message
- Samba 3 with Windows 2008 Enterprise Terminalserver
- Samba freezes server when writing 50MB MS Word document (sometimes)
- [HVM][XENOPROFILE][PATCH][3/4] oprofile HVM specific functionality
- [HVM][SVM][PATCH][1/2] VINTR intercept signal