Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Gabriel Becker
Hi all, I think there's some nuance here that makes makes me agree partially with each "side". The pipe is inarguably extremely popular. Many probably think of it as a core feature of R, along with the tidyverse that (as was pointed out) largely surrounds it and drives its popularity. Whether its

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Ant F
Yes but this exageration precisely misses the point. Concerning your examples: * I love fread but I think it makes a lot of subjective choices that are best associated with a package. I think it changed a lot with time and can still change, and we have great developers willing to maintain it and

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Iñaki Ucar
On Sat, 5 Oct 2019 at 19:54, Hugh Marera wrote: > > [...] it is not very difficult to find functions in dplyr or data.table or > indeed other packages that one may wish to be in base R. Examples, for me, > could include data.table::fread You have utils::read.table and the like. > dplyr::group_

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Hugh Marera
I exaggerated the comparison for effect. However, it is not very difficult to find functions in dplyr or data.table or indeed other packages that one may wish to be in base R. Examples, for me, could include data.table::fread, dplyr::group_by & dplyr::summari[sZ]e combo, etc. Also, the "popularity"

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Ant F
Hi Rui, > R is a functional language, pipes are not. There are even higher order functions such as [1] and [2]. If they can be build in R, either R is not a functional language, or pipes are part of a functional language. Could you elaborate ? What point would you make against pipes that you coul

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Iñaki Ucar
On Sat, 5 Oct 2019 at 18:10, Rui Barradas wrote: > > R is a functional language, pipes are not. How would you classify them? Pipes are analogous to function composition. In that sense, they are more functional than classes, and R does have classes. Anyway, I don't see "purity" as a valid argumen

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Iñaki Ucar
On Sat, 5 Oct 2019 at 17:15, Hugh Marera wrote: > > How is your argument different to, say, "Should dplyr or data.table be > part of base R as they are the most popular data science packages and they > are used by a large number of users?" Two packages with many features, dozens of functions and

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Rui Barradas
Hello, R is a functional language, pipes are not. There are even higher order functions such as [1] and [2]. Besides, packages are part of R, R couldn't live without them. I find pipes a good idea but I also find it better not to have them as part of base R. If you want to use them, load a pac

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread John Mount
Many of those issues can be dealt with by introducing curly braces: compose <- function(f, g) { function(x) g(f(x)) } plus1 <- function(x) x + 1 plus2 <- { plus1 ->.; compose(., plus1) } plus2(5) # [1] 7 And a lot of that is a point to note: we may not all

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Ant F
Hi John, Thanks, but the Bizzaro pipe comes with many flaws though : * It's not a single operator * It has a different precedence * It cannot be used in a subcall * The variable assigned to must be on the right * It doesn't trigger indentation when going to the line * It creates/overwrite a `.` va

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread David Hugh-Jones
I +1 this idea, without judging the implementation details. The pipe operator has proven vastly popular. Adding it would be relatively easy (I think). Having it as part of the core would be a strong guarantee of the future stability of this syntax. On Sat, 5 Oct 2019 at 15:34, Ant F wrote: > D

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Hugh Marera
How is your argument different to, say, "Should dplyr or data.table be part of base R as they are the most popular data science packages and they are used by a large number of users?" Kind regards On Sat, Oct 5, 2019 at 4:34 PM Ant F wrote: > Dear R-devel, > > The most popular piping operator

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread John Mount
Actually, base R already has a pipe fairly close to the one you describe: ->.; iris ->.; head(.) ->.; dim(.) # [1] 6 5 I've called it the Bizarro pipe ( http://www.win-vector.com/blog/2016/12/magrittrs-doppelganger/

Re: [Rd] should base R have a piping operator ?

2019-10-05 Thread Jeff Ryan
Is there some concrete example of your “many workflows don’t even make much sense without pipes nowadays” comment? I don’t think I’m opposed to pipes in the absolute, but as I am now deep into my second decade of using R I’ve done just fine without them. As I would guess have the vast majority of

[Rd] should base R have a piping operator ?

2019-10-05 Thread Ant F
Dear R-devel, The most popular piping operator sits in the package `magrittr` and is used by a huge amount of users, and imported /reexported by more and more packages too. Many workflows don't even make much sense without pipes nowadays, so the examples in the doc will use pipes, as do the READM