[R] merge function

John Kane jrkrideau at inbox.com
Mon Jun 1 16:31:04 CEST 2015


Let me try this again. Here are the links I forgot. My apologies.
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and http://adv-r.had.co.nz/Reproducibility.html

John Kane
Kingston ON Canada


> -----Original Message-----
> From: jrkrideau at inbox.com
> Sent: Mon, 1 Jun 2015 06:29:41 -0800
> To: wht_crl at yahoo.com, r-help at r-project.org
> Subject: RE: [R] merge function
> 
> As Burt says it is not exactly clear what you want but is something like
> this what you are looking for?
> 
> dat1  <-  data.frame(aa = c("a", "b", "c"), bb = 1:3)
> dat2  <-  data.frame(xx = c("b", "c", "d"), yy = 3:1)
> merge(dat1, dat2, by.x = "aa", by.y = "xx")
> 
> For further reference here are some suggestions about asking questions on
> the R-help list.  In particular it is very helpful if data is supplied in
> dput() form (See ?dput for details)
> 
> John Kane
> Kingston ON Canada
> 
> 
>> -----Original Message-----
>> From: r-help at r-project.org
>> Sent: Mon, 1 Jun 2015 13:46:15 +0000 (UTC)
>> To: r-help at r-project.org
>> Subject: [R] merge function
>> 
>> Hi,By default the merge function should take the intersection of column
>> names (if this is understood from by = intersect(names(x), names(y)),
>> but
>> it takes all columns. How to specify the intersection of column names?
>>  Thanks
>> Carol
>> 
>> 	[[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> ____________________________________________________________
> Can't remember your password? Do you need a strong and secure password?
> Use Password manager! It stores your passwords & protects your account.
> Check it out at http://mysecurelogon.com/manager

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!



More information about the R-help mailing list