Earlier quoted context omitted.
No surprise there - pandas encourages ugly, inefficient code with its bloated, unintuitive API. Once I was a lead on a new project and asked the intern to write some basic ETL code for data in some spreadsheets. I said she could write it in Python if she wanted, because "Python is good for ETL", right? This intern was not dumb by any means, but she wrote code that took 5 minutes to do something that can be done in Al…
R’s meta programming facilities are head and shoulders above Python’s, which I think explains the brilliance of dplyr and dbplyr. But I feel like with R you have to scrape back a bunch of layers to get to the Schemey parts. I’ve always wondered what Hadley and Co would have done with dplyr and dbplyr had they had something like Racket at their disposal.
R adds native pipe and lambda syntax
51–60 of 150 posts
Re: R adds native pipe and lambda syntax
#52personally Im surprised R is still in active development when the main use case for people to use R (at least when I was using it) was for statistical analysis. Python with its libraries (a lot I believe ported from R) just does is nicer, and faster.
R vs. Python flamewars always strike me as a Budweiser vs. Miller kind of argument. Neither is really a “craft beer” of programming languages. Neither are super remarkable as programming languages. Both made a bunch pragmatic tradeoffs to appeal to large audiences that share similar values—both are “average joe” beers. Python has comparative advantages over R in production roles. R has comparative advantage in statis…
Re: R adds native pipe and lambda syntax
#53Earlier quoted context omitted.
No surprise there - pandas encourages ugly, inefficient code with its bloated, unintuitive API. Once I was a lead on a new project and asked the intern to write some basic ETL code for data in some spreadsheets. I said she could write it in Python if she wanted, because "Python is good for ETL", right? This intern was not dumb by any means, but she wrote code that took 5 minutes to do something that can be done in Al…
IMO they should just bite the bullet and learn proper SQL. I say this as a data scientist who learned SQL later than C, Matlab, R, Python/Pandas (though earlier than PySpark).
Re: R adds native pipe and lambda syntax
#54The lambda thing may be useful. Sometimes I was tempted to do something like this > f sapply(1:4, f({ a but I'm not sure it would have worked well. The new syntax is of course also more flexible.
Re: R adds native pipe and lambda syntax
#55I'm sure some of us who are out of the loop might be wondering: what about the magrittr pipe operator (%>%) that we all know and love? Luke Tierney explains the move from %>% to a native pipe |> here [1]. The native pipe aims to be more efficient as well as addresses issues with the magrittr pipe like complex stack traces. Turns out the |> syntax is also used in Julia, Javascript and F#. The lambda syntax (\(x) -> x…
Genuinely curious why not combine syntax? Do we need 2 different pipes in R? When to use which? Thanks for your thoughts!
Re: R adds native pipe and lambda syntax
#56personally Im surprised R is still in active development when the main use case for people to use R (at least when I was using it) was for statistical analysis. Python with its libraries (a lot I believe ported from R) just does is nicer, and faster.
Python is wonderful but the cognitive load for switching in industry and academia without a clear cost benefit isn't worth it to most people I know in my shoes. I encourage new coders to learn Python but discounting R feels a bit asinine.
Hadley is still actively doing work for R which has led to a graphing packages that is substantially better than anything in Python (last I check). I have no doubt that Python will steal it and implement it eventually (as they should) but R is still doing firsts that Python hasn't (note the native implementation of Piping, they're late to the party on lambda functions obviously)
Re: R adds native pipe and lambda syntax
#57Re: R adds native pipe and lambda syntax
#58This sounds promising, but how do we type that pipe easily if we're going to be using it all the time? I actually like %>% because it's easy to reach the keys and hammer it out. Agreed on the ugly stack traces.
Re: R adds native pipe and lambda syntax
#59This sounds promising, but how do we type that pipe easily if we're going to be using it all the time? I actually like %>% because it's easy to reach the keys and hammer it out. Agreed on the ugly stack traces.
Re: R adds native pipe and lambda syntax
#60https://www.tidyverse.org/blog/2020/11/magrittr-2-0-is-here/