Re: [R] Merging Issue

2016-06-18 Thread jim holtman
Don't use HTML on sending email- messes up the data. What do you mean that you get lots of duplicates? If you have duplicated entries in df2 this will lead to dups because of the way merge works (here is the help file): If there is more than one match, all possible matches contribute one r

[R] Merging Issue

2016-06-17 Thread Farnoosh Sheikhi via R-help
Hi all,  I have two data sets similar like below and wanted to merge them with variable "deps". As this is a sample data with small sample size, I don't have any problem using command merge. However, the actual data set has ~60,000 observations with a lot of repeated measures. For example, for a

Re: [R] merging issue.........

2010-01-13 Thread karena
thank you very much! -- View this message in context: http://n4.nabble.com/merging-issue-tp1013356p1013433.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] merging issue.........

2010-01-13 Thread Heinz Tuechler
Did you consider to look at the help page for merge? h At 22:01 13.01.2010, karena wrote: hi, I have a question about merging two files. For example, I have two files, the first file is like the following: id trait1 110.2 211.1 39.7 610.2 78.9 10 9.7 11 10.2 The second

Re: [R] merging issue.........

2010-01-13 Thread Adrian Dusa
Hi Karean, If your first object is called obj1 and the second called obj2, then: > merge(obj1, obj2, all.x=TRUE) id trait1 trait2 1 1 10.29.8 2 2 11.1 10.8 3 39.7 NA 4 6 10.2 10.1 5 78.9 NA 6 109.7 NA 7 11 10.2 NA Hope this helps, Adrian On Wed

[R] merging issue.........

2010-01-13 Thread karena
hi, I have a question about merging two files. For example, I have two files, the first file is like the following: id trait1 110.2 211.1 39.7 610.2 78.9 10 9.7 11 10.2 The second file is like the following: idtrait2 1 9.8 2 10.8 4 7.8 5 9.8 6 10.1

Re: [R] merging issue.........

2010-01-13 Thread Pete B
Try the merge function ?merge in1 = "id trait1 110.2 211.1 39.7 610.2 78.9 10 9.7 11 10.2 " in2 = "id trait2 1 9.8 2 10.8 4 7.8 5 9.8 6 10.1 1210.2 1310.1 " data1 = read.table(textConnection(in1), header=T) data2 = read.table(tex