4 ms·
My 2¢ on the tidyverse is that it is a bit misleading to call it "a collection of packages". I think it would be more accurate to call it a "framework". Though
by tpoacher 4y ago
My 2¢ on the tidyverse is that it is a bit misleading to call it "a collection of packages". I think it would be more accurate to call it a "framework". Though I suppose "opinionated collection of packages" is perhaps a fuzzy synonym for framework.
The difference between "collection of packages" and "framework" is that "collection of packages" implies interoperable via API conventions, but otherwise standalone packages, which could easily be used in isolation alongside base R.
Whereas "framework" generally means tightly coupled components, in a "do things my way or the highway" fashion.
Technically speaking, it's not "impossible" to mix tidyverse with base R, but in general if you wanted to mix and match tidy vs base R syntax, you'd find yourself working "against" the tidy api rather than alongside it most of the time.
R is not my main language, but every time I come across a task and I need to make a decision between R vs tidyR, the two feel like completely different languages.
I also have some beef against some of the decisions/conventions used (e.g. abusing metaprogramming to pass variables and use the variable's label as a value, completely ignoring the variable's actual value, instead of passing it as a string or as an actual variable ... seriously confusing when you first come across it).
- kgwgk 4y ago> Whereas "framework" generally means tightly coupled components, in a "do things my way or the highway" fashion. Using that definition how would lubridate be part of the tidyverse "framework"? > Technically speaking, it's not "impossible" to mix tidyverse with base R, but in general if you wanted to mix and match tidy vs base R syntax, you'd find yourself working "against" the tidy api rather than alongside it most of the time. I don't know, wrapping readxl::read_excel with a as.data.frame or as.data.table call works beautifully for me.
- RosanaAnaDana 4y agoI think he's almost certainly speaking of the %>% group_by convention that is basically demanded of within the tidyworld. I load magrittr and ggplot and toss the rest out. Right to left reading order is all I really want from that world. Data tables are such a superior convention to tibbles that it's not even funny (I need a tibbles like I need another hole in the head).
- HFguy 4y agoWhat is wrong with tibbles?
- Bootvis 4y agoThey are not data.tables and sometimes I prefer working with data.tables.
- kuhewa 4y agoTheir print method annoys me and I don't like the benevolent paternalism of attempting to prevent you from modifying indexes of the dataframe.
- nequo 4y agoI was (wrongly) guessing performance. Tibbles are ok for smaller data sets where data transformations don’t need to be in place and there’s no risk of running out of RAM. Data tables perform better, at the cost of what I think is a less ergonomic interface. See benchmarks here (compare data.table with dplyr): https://h2oai.github.io/db-benchmark/ https://h2oai.github.io/db-benchmark/
- kuhewa 4y agoBut base r already has split() which does the same thing, turns a dataframe into a list of dataframe divided by values of a column. With the base r pipe operator and base functions like subset, aggregate, transform, split, you can basically replicate that convention while loading exactly no tidyverse packages. You can also use group_by(data, column) without a pipe if wanting to smuggle in a specific dplyr function.
- RosanaAnaDana 4y agoI think this is a great framing. The tidy verse framework is straight up antagonistic towards base R and any non Hadleyverse packages wwith minor exception. The other glaring rhino in the room is the relationship between RStudio and the Hadleyverse. I find the relationship and degree of influence the tidy verse and Hadleyite way of doing things to be a dark cloud over the R community.
- HFguy 4y agoWhy is it a dark cloud? Could you just choose to not use tidyverse libraries?
- iaw 4y agoMy experience is that usually leveraging quosures I can make a wrapper function to get Hadlerverse behavior from any other packages. I believe that Hadley's work is the driving reason R remains a competitive alternative to Python for data analysis.
- jwilber 4y agoI honestly don’t believe R would have any sort of user-base at all if the tidyverse didn’t exist
- civilized 4y agoEh, framework is a bit strong (if we're thinking about something like Ruby on Rails). You can easily mix dplyr and lubricate with base R things like for loops, subscripted assignments, low-level functions like grep, etc. I do it all the time. I agree that nonstandard evaluation can be tricky, but the nice notation you get is worth it IMHO, and at this point you can switch to standard evaluation in a number of convenient ways. My favorite way is to just use base R temporarily, since outside of modeling functions it mostly works by standard eval. And I think that's good advice in general. The best way to use the Tidyverse is to use it for what it's good at. And for things it's not so good at, use something else for a bit before coming back to it.
- kuhewa 4y agoI find it entirely possible and it's my normal work flow to mix a little tidyverse in with base R without going against the grain, the worst it gets its probably converting data from long to wide format now and again but the functionality to do so is intuitive and simple. Bigger differences between graphics but there wouldn't be a need to mix ggplot grid graphics and base r graphics in the same plot (although panels in the same multi figure plot for example is trivial).