Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidyverse vs 'base' R (Language Unity) #13

Open
pablox-cl opened this issue Jun 14, 2019 · 9 comments
Open

Tidyverse vs 'base' R (Language Unity) #13

pablox-cl opened this issue Jun 14, 2019 · 9 comments

Comments

@pablox-cl
Copy link

I have been learning R in a mix using base R and the tidyverse (mostly dplyr). I got concerned about Language Unity, because I could started to use R thanks to the tidyverse (just my experience of course) before using dplyr it was just too hard.
Have you ever written in detail about this issue so I can read more?

@pablox-cl pablox-cl changed the title Tidyverse vs 'base' R Tidyverse vs 'base' R (Language Unity) Jun 14, 2019
@matloff
Copy link
Owner

matloff commented Jun 14, 2019

I don't think of dplyr as tidyverse.

@BobMuenchen
Copy link

The tidyverse does make many things easy, but it also adds complexity for even simple things like printing: https://www.r-bloggers.com/the-tidyverse-curse/.

@matloff
Copy link
Owner

matloff commented Jun 14, 2019

Thanks for the link to the "curse" comment. I once saw a posted writeup of the "proper" way to do "Hello world!" in Java, and it was something like 20 lines long!

@BobMuenchen
Copy link

Your comment about unity got me wondering what the ratio of base to tidyverse functions might be. Summing the length(getNamespaceExports("package_name") on base, stats, utils, methods, and graphics gets 2,519 functions. Doing the same on the tidyverse packages gets 1,162 functions. So the tidyverse is nearing half the size of the main R installation (I skipped Autoloads, and grDevices, guessing that they're shared by both).

@pablox-cl
Copy link
Author

@BobMuenchen thanks for the link!

@matloff oh, then I'm more lost. I understand that the tidyverse is a collection of tools, being dplyr one of the most important, and also dplyr uses pipes a lot, that's why I made the link :). Could you clarify when the issue arises?

@matloff
Copy link
Owner

matloff commented Jun 14, 2019

Correct me if I am wrong, but I don't think the original dplyr used pipes, and moreover, it certainly would not have to.

@stevekm
Copy link

stevekm commented Jun 14, 2019

Don't overlook the issue of unnecessary dependencies. Every time you include a non-base R library, you now have to drag along and version control that library every where you want to use your code. This is not trivial, and is the source of many problems when working on teams or shared projects across multiple systems. Years of experience have shown that you should simply learn the base-R methods of doing most things (easily findable on Stack Overflow) and avoid dyplr, tidyverse, etc. The few edge cases that can't be adequately handled with base R are generally solved with reshape2 and data.table and the like, barring things like ggplot2, knitr, etc. which are non-base essentials.

@pablox-cl
Copy link
Author

pablox-cl commented Jul 18, 2019

@matloff no, you don't need to. But if you see the documentation for dplyr the magrittr pipe (%>%) appears ubiquitously. That's why I made the relation.

@stevekm I understand the problem of unnecessary dependencies. I suppose in the end, it will always depends on the compromises you need to make for the sake of your project.


Edit: I don't know how old is this other article, but I believe answers the issue I was asking perfectly: https://github.com/matloff/TidyverseSkeptic Thanks!

@matloff
Copy link
Owner

matloff commented Jul 18, 2019

Yes, please see my TidyverseSkeptic page, which I update constantly.

There is nowhere, including in dplyr, where pipes are necessary.

The issue of UNNECESSARY dependencies is a serious one. Not only is it a nuisance, but also can cause trouble in a shared system situation, e.g. a school.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants