From kev|nu@hey @end|ng |rom gm@||@com  Mon Oct  7 18:42:13 2019
From: kev|nu@hey @end|ng |rom gm@||@com (Kevin Ushey)
Date: Mon, 7 Oct 2019 09:42:13 -0700
Subject: [Rd] [External] Re: should base R have a piping operator ?
In-Reply-To: <alpine.DEB.2.21.1910071052330.14507@luke-Latitude-7480>
References: <CAEKh8uidcEWA4tzmkpQxpF=q7r93qjf-HtiWLfbT91TFGOSzFQ@mail.gmail.com>
 <CAGpovd2jxxWBUxPhMAR6ZPw1+UQzK7BzJVtps10cMBSp=EUdHQ@mail.gmail.com>
 <CALEXWq0ZvGeTbeq-AeYTSTcTwR-TR+gGczqQhWupzB2h0wa+zg@mail.gmail.com>
 <CAGpovd29V3rXSyB_SMBnbKfb3dzAFPF66ck9iU6XPB_+bS+8WQ@mail.gmail.com>
 <CAEKh8ugr0FNryRVmM64pBPxjP=4xLrC0T2OsUD27mSASAyHpVQ@mail.gmail.com>
 <CAD4oTHHgSUr5TfLaTHxAM94E-Sqw9bW6gON7KdW324VEr524Lw@mail.gmail.com>
 <95648642-FCC6-49BE-93D9-8872172946E6@rstudio.com>
 <alpine.DEB.2.21.1910071001350.14507@luke-Latitude-7480>
 <ABABA4EA-88E4-4E22-B256-214050E8720A@rstudio.com>
 <alpine.DEB.2.21.1910071052330.14507@luke-Latitude-7480>
Message-ID: <CAJXgQP0qBoY+4pmfUfoiSTtJ+KNm25k8umyYkL2s8fxu0GH2Tw@mail.gmail.com>

IMHO, if base R were to include a pipe operator, I think it should be much
simpler than the magrittr pipe. It should satisfy the property that:

    x |> f(...)   is equivalent to   f(x, ...)

Except, perhaps, in terms of when the promise for 'x' gets forced. We
shouldn't need to mess with bindings in environments to make that work.

My understanding is that the '.' placeholder is used so that the magrittr
pipe can be adapted to functions that aren't endomorphic or otherwise
easily pipeable. I would argue that:

1. Users could just create their own pipable wrapper functions if so
required, or
2. Users could use magrittr to get some of the 'extensions' to the pipe
operator (with the noted caveats).

Best,
Kevin

	[[alternative HTML version deleted]]



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