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

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

2010-08-21 Thread Cecilia Carmo
Hi everyone, I have been merging many big dataframes (about 8 rows each) and I never had this problem, but now it happened to me and I want to know if someone knows what could be happening. The final dataframe has many rows, an impossible number! I have done edit(dataframe) and I saw that