Live data from Hacker News

An opinionated view of the Tidyverse “dialect” of the R language

github.com

51–60 of 156 posts

Re: An opinionated view of the Tidyverse “dialect” of the R language

#51
post #38

Earlier quoted context omitted.

The R standard library is kind of weird and hard to use for "general purpose" programming. It's very clearly a domain specific language. Also, it's unbelievably slow for basic operations like looping, function calls, and variable assignment. It's literally orders of magnitude slower than Python (I've tested it). Unlike its fellow C-flavored-Lisp Javascript, R retains an extreme level of homoiconicity, Which apparentl…

Are you aware of Radford Neal’s pqR? https://radfordneal.wordpress.com/

I had heard of it in the past but I didn't realize it was in a finished state and keeping pace with recent R versions. I'll read up on it, thank you.

Edit: looks like it's still a full major version behind? To be fair, there weren't many significant changes between R 2.x and 3.x.

Re: An opinionated view of the Tidyverse “dialect” of the R language

#52
I teach and consult on R and data science. I had the privilege of learning R from one of R's core developers. My students often ask why I don't use the Tidyverse. The answer is because I don't need to - I can do everything the Tidyverse does and so much more in base R.

This article only briefly touches on what I think is the biggest issue with the Tidyverse. The Tidyverse is incredibly limiting. The "tidy" workflow hides many details of the language, which leads many users to think all data has to be in a tidy "data.frame" (or now tibble) and organized just so. The functions the Tidyverse authors have chosen to implement are seen as the limits of R's capabilities. Every data problem has to be forced into the Tidyverse box (or it is impossible). I cannot tell you how many Tidyverse scripts I have seen where 90% of the operations are munging the data into the correct format for the Tidyverse functions, when the original data can be handled with a single base R function (e.g. lapply). Most Tidyverse users accept this as just the way R is.

Most R users who only learn the Tidyverse never hit its limits, and for them the Tidyverse is perfectly OK. Those that do either resign themselves to the perceived limits of R, or (hopefully) start learning some base R. One friend who took the latter path once exclaimed to me "Logical subsetting is amazing!?!" - this is a foundation piece of the language. That she went 2+ years in the "Tidyverse" without even knowing it was an option was eye opening to me.

To its credit, the Tidyverse is empowering - with very little programming knowledge a beginner can do a lot of data science. However, the majority of these people get stuck as "expert beginners". Some of these become fierce advocates of the Tidyverse without truly understanding base R. Meanwhile, none of the truly advanced R users I encounter use the Tidyverse.

ed.typo

Re: An opinionated view of the Tidyverse “dialect” of the R language

#53
I initially viewed this article with skepticism, rather liking the functional style of the Tidyverse.

However, the claims the author makes are entirely valid. Data table is a fantastic package, and easy to learn. Tidyverse really has split the R community in disparate sets of R users.

To my mind, one of R’s greatest strengths is its meta programming capabilities. It is this that allows such broad paradigms to exist within the same language. In that, the challenges that R is presented with is similar to languages like Lisp dialects and Scala.

I don’t have solutions, but the author has convinced me that a problem is indeed there.

Re: An opinionated view of the Tidyverse “dialect” of the R language

#54
post #30

As someone who uses and teaches R extensively (and loves the tidyverse) the tidyverse is so much easier to teach to people without any programming experience and who have very little faith in their tech or maths skills (which was me as well). The tidyverse just 'made sense' to me when I started using R for the first time a few years ago, and now I love using R and programming. On the other hand, some of my ex-classma…

I concur with your sentiments having cultivated data science teams from the ground up with diverse educational backgrounds.

Programming in base R is more akin to assembly language and has accreted a babel of inconsistencies that make it difficult to teach and learn. Learning base R isolates you into a Galapagos island of academics who are either ignorant of the needs of data workers or too elitist to engage with those not in their priesthood.

Learning Tidyverse is a considerably better transition for learning other languages, frameworks, and libraries.

Functional programming is closer to algebra than indexing into data structures with magic numbers. I've found more success teaching functional pipelines of data structures using the idioms in Tidyverse as a general framework for data work than base R. Abstraction has a cost but for learning it is the appropriate cost.

I sense that much of this `monopolistic` fear mongering is really about feeling out of date.

Re: An opinionated view of the Tidyverse “dialect” of the R language

#55
From personal experience, I learned R during college as a part of my stats courses, before tidyverse even existed.

After doing a few personal projects using base R with complex manipulations, I would have quit using R entirely if it were not for tidyverse/dplyr.

I'm a pragmatic software engineer: I prefer to get a data analysis job as fast as necessary, and IMO there isn't much merit in making things more complicated by using base R just for the sake of base R. It's definitely not faster, both in cognitive load and in speed. In my data science work there hasn't been a single case where I've needed to fall back to base R, or wanted to.

Pipes are being undersold here: the examples only show a single piped action, whereas pipes shine when you have to do 5+ operations in a single manipulation (I've seen base R code that does that by just having a lot of redundant df assignments and it's a pain to read).

Re: An opinionated view of the Tidyverse “dialect” of the R language

#56
post #38

Earlier quoted context omitted.

Are you aware of Radford Neal’s pqR? https://radfordneal.wordpress.com/

I had heard of it in the past but I didn't realize it was in a finished state and keeping pace with recent R versions. I'll read up on it, thank you. Edit: looks like it's still a full major version behind? To be fair, there weren't many significant changes between R 2.x and 3.x.

Well, it may not be keeping up with the new versions but at least it does cover a non-trivial subset of the standard implementation. :-)

I have not tried it in many years and I don't know how much faster or compatible it is. Nevertheless, I think it's a good thing that an "outsider" is looking at performance issues.

As far as I know it's essentially a one-man's effort. One could imagine that RStudio or Microsoft would be able to improve R performance substantially if they wanted to.

Re: An opinionated view of the Tidyverse “dialect” of the R language

#57

In this article and others I've read, people complain about the tidyverse's lack of performance, but I think that places too much emphasis on speed of execution versus speed of development. As an academic, most of the R users I know only code as a portion of their scientific projects. Besides data analysis we're doing data collection, manuscript writing and grant writing. The tidyverse's more english-like syntax (eg…

This is my experience as a data engineer/analyst. I work in the healthcare space and my analyses are run on datasets that are at the uppermost half a million rows. Yes, data.table is faster than dplyr/tibbles, but i dont care. Like you said, most of my time is spent on expressing my thoughts into code, not running the code. Tidyverse really simplifies it compard to base R.

Its good to know tools like data.table exist though, people shouldnt think the tidyverse is the only way to do things.

Re: An opinionated view of the Tidyverse “dialect” of the R language

#58
I was waiting for the critique... but I never quite saw it.

Imho, the data problem Tidyverse is trying to solve is basically the ones we face in a database. So, select, join, inner join and so forth. Show me all the rows in this datatable where the 4th columm is larger than the 6th column and the number itself is odd. Something like that.

There might be other ways to do it, but you want your select, filter, summarize, mutate etc functions to all work with each other, pipe to each other and be compatible.

Maybe there is a better way to do all this -- I haven't seen it but I am not an expert -- but you have to show that to me.

So, in base R, walk through a set of example of mutating, joining, filtering and so forth, and show me how they are all easier. Then I'll say, wow there is an alternative to this Tidyverse thing. But in lieu of that demo, this felt more like an intro to a complaint than an actual complaint.

Edit: Also, its funny that Wickham is (apparently) such a nice fellow that people go out of the way to be nice to him in critiques.

Re: An opinionated view of the Tidyverse “dialect” of the R language

#59
post #49

At least in my case, although I do like some of the tidyverse (ggplot is tidyverse after all, and probably my favorite plotting system in any language), I find the "tibble" data structure and its disdain for row names really annoying. Many, many, packages which I use expect a data frame with row names and likewise output such. So I am constantly converting back and forth between tibbles and data frames.

The claim that ggplot2 is tidyverse can be disputed. It existed before and works fine outside of it.

ggplot2 is under the tidyverse umbrella, and will be installed/loaded with library(tidyverse).

The original article is more about dplyr though.

Re: An opinionated view of the Tidyverse “dialect” of the R language

#60

I guess I am what you would call an R power user. What’s really crazy is I never realized how fast and easy excel pivot tables were to work with. I know I know it sounds ridiculous. But if you do a lot data splicing and dicing, excel can actually get your cuts out way faster through pivot tables than writing R code. So if you use R for almost everything, give Excel a try as well. And the nice thing is this is even mo…

Agree 100%, but only if it is a one time activity. If you have to automatically pull files and do the operation several times, it is better to go with R (or python, or awk sed or whatever).
Post reply on HN