join vs merge

Showing 1-4 of 4 messages
join vs merge Roger Bos 1/30/14 12:56 PM
All,

Can anyone confirm if join() is better than merge()?  I am assuming it is because why else write a new function when there is a function is base R to do it.  My second question is why is join not exported by dplyr?  It seems that if I want to use join I have to load plyr and dplyr.  I just wanted to confirm that that is indeed the case.

Thanks,

Roger

Re: join vs merge Hadley Wickham 1/30/14 1:01 PM
join is a plyr function. dplyr has inner_join, left_join, semi_join and anti_join.  The advantages of the dplyr versions over merge are:

* rows are kept in existing order
* much faster
* tells you what keys you're merging by (if you don't supply)
* also work with database tables.

Hadley


--
You received this message because you are subscribed to the Google Groups "manipulatr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manipulatr+...@googlegroups.com.
To post to this group, send email to manip...@googlegroups.com.
Visit this group at http://groups.google.com/group/manipulatr.
For more options, visit https://groups.google.com/groups/opt_out.



--
http://had.co.nz/
Re: join vs merge Roger Bos 1/30/14 1:38 PM
Do those advantages apply to plyr::join or only dplyr::join?  I am not sure which version I am using as when I don't load the plyr package the join function cannot even be found.

Thanks,

Roger
Re: join vs merge Hadley Wickham 1/30/14 1:45 PM
There's only plyr::join.  plyr::join has the same advantages as dplyr::inner_join etc, except that it's nowhere near as fast.

Hadley


--
You received this message because you are subscribed to the Google Groups "manipulatr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manipulatr+...@googlegroups.com.
To post to this group, send email to manip...@googlegroups.com.
Visit this group at http://groups.google.com/group/manipulatr.
For more options, visit https://groups.google.com/groups/opt_out.



--
http://had.co.nz/