|join vs merge||Roger Bos||1/30/14 12:56 PM|
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.
|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.
|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.
|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.