[Rd] [External] Re: New pipe operator

Gabor Grothendieck ggrothend|eck @end|ng |rom gm@||@com
Tue Dec 8 22:23:30 CET 2020


On Mon, Dec 7, 2020 at 9:09 AM Gabor Grothendieck
<ggrothendieck using gmail.com> wrote:
>
> On Sat, Dec 5, 2020 at 1:19 PM <luke-tierney using uiowa.edu> wrote:
> > Let's get some experience
>
> Here is my last SO post using dplyr rewritten to use R 4.1 devel.  Seems

It occurred to me it would also be interesting to show this example
rewritten using John Mount's bizarro pipe
(which is clever use of syntax to get the effect of a pipe) with the
new \(x) ...
This can be done entirely in base R 4.1.  It does not use \>, just \(x)...

  "myfile.csv" ->.;
    readLines(.) ->.;
    gsub(r'{(c\(.*?\)|integer\(0\))}', r'{"\1"}', .) ->.;
    read.csv(text = .) ->.;
    replace(., 2:3, lapply(.[2:3], \(col) lapply(col, \(x)
eval(parse(text = x))))) ->.;
    . -> DF



More information about the R-devel mailing list