Re: [R] Problems with merge

2013-05-29 Thread arun
data1$A[8] #[1] 1.4  data2$A[15] #[1] 1.4  data2$A[15]==data1$A[8] #[1] FALSE You can check these links: http://r.789695.n4.nabble.com/Comparing-decimal-numbers-td3251437.html http://rwiki.sciviews.org/doku.php?id=misc:r_accuracy A.K. >The FAQ says "Other numbers have to be rounded to (typically

Re: [R] Problems with merge

2013-05-28 Thread arun
HI, Possibly R FAQ: 7.31  data1New<-data1  data1New$A<- round(data1New$A,2)  data2New<- data2  data2New$A<- round(data2New$A,2) merge(data1New,data2New,by="A") #    A   B    C #1 0.0 0.9 10.0 #2 1.1 0.6 11.1 #3 1.4 0.7 11.4 #4 3.1 0.4 13.1 #5 4.4 0.8 14.4 A.K. Hello, Lets say we have these

Re: [R] problems with merge() - the output has many repeated lines

2010-08-23 Thread Cecilia Carmo
.org [mailto:r-help-boun...@r-project.org] On Behalf Of Cecilia Carmo Sent: Sunday, August 22, 2010 10:24 AM To: Erik Iverson Cc: r-help@r-project.org; Hadley Wickham Subject: Re: [R] problems with merge() - the output has many repeated lines I have done intersect(names(df1), names(df2)) [1] &q

Re: [R] problems with merge() - the output has many repeated lines

2010-08-23 Thread Michael Dewey
At 18:23 22/08/2010, Cecilia Carmo wrote: I have done intersect(names(df1), names(df2)) [1] "firm" "year" This is the key I used to merge merge(df1,df2,by=c("firm","year")) And there is just one row firm/year in df1 that matches with another firm/year row in df2. Df1 has more firm/year rows t

Re: [R] problems with merge() - the output has many repeated lines

2010-08-22 Thread Brad Patrick Schneid
?unique -- View this message in context: http://r.789695.n4.nabble.com/problems-with-merge-the-output-has-many-repeated-lines-tp2333596p2334249.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://

Re: [R] problems with merge() - the output has many repeated lines

2010-08-22 Thread Cecilia Carmo
I have done intersect(names(df1), names(df2)) [1] "firm" "year" This is the key I used to merge merge(df1,df2,by=c("firm","year")) And there is just one row firm/year in df1 that matches with another firm/year row in df2. Df1 has more firm/year rows than df2, and them don't match with none in

Re: [R] problems with merge() - the output has many repeated lines

2010-08-22 Thread Erik Iverson
Cecilia - Find what columns you're matching on, intersect(names(df1), names(df2)), Maybe that will shed some light on the issue. On 08/22/2010 12:02 PM, Cecilia Carmo wrote: Thanks, but I don't have multiple matches and the lines repeated in the final dataframe are exactly equal in all column

Re: [R] problems with merge() - the output has many repeated lines

2010-08-22 Thread Cecilia Carmo
Thanks, but I don't have multiple matches and the lines repeated in the final dataframe are exactly equal in all columns. Cecília Sat, 21 Aug 2010 10:58:53 -0500 Hadley Wickham escreveu: You may find a close reading of ?merge helpful, particularly this sentence: "If there is more than one

Re: [R] problems with merge() - the output has many repeated lines

2010-08-21 Thread Hadley Wickham
You may find a close reading of ?merge helpful, particularly this sentence: "If there is more than one match, all possible matches contribute one row each" (so check that you don't have multiple matches). Hadley On Sat, Aug 21, 2010 at 10:45 AM, Cecilia Carmo wrote: > Hi everyone, > > I have be