Re: [R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread Ista Zahn
Hi Ryan, You're getting this result because five of the rows in a.one.qtr are duplicates, as a results of sampling with replacement: length(which(duplicated(a.one.qtr))) [1] 5 The relevant section of the documentation (see ?merge) reads "The rows in the two data frames that match on the specifie

Re: [R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread Sarah Goslee
Hi, Why do you need to merge them? c.one contains what I think you want, and then you want to randomly select 25 rows from that without replacement: c.one <- cbind(c.one, a.qtr = sample(c(rep(TRUE, 25), rep(FALSE, 75 > head(c.one) unique length age a.qtr 649649 71 4 TRUE 200

Re: [R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread Petr Savicky
On Mon, Feb 06, 2012 at 12:29:53PM -0800, RKinzer wrote: > Hello all, > > First I have done extensive searches on this forum and others and nothing > seems to work. So I decided to post thinking someone could point me to the > write post or give me some help. > > I have drawn a 100 samples from

[R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread RKinzer
Hello all, First I have done extensive searches on this forum and others and nothing seems to work. So I decided to post thinking someone could point me to the write post or give me some help. I have drawn a 100 samples from a fictitious population (N=1000), and then randomly selected 25% of the