Re: [Rd] Additional an example for the forward pipe operator's documentation

2021-06-19 Thread Brenton Wiernik
> mtcars |> subset(cyl == 4) |> lm(formula = mpg ~ disp) This isn’t really a reliable approach. It works for `lm()`, where `data` is the second argument, but not for `glm()` unless the first _two_ arguments are named. mtcars |> subset(cyl == 4) |> glm(formula = mpg ~ disp, family = "gaussian")

Re: [Rd] Additional an example for the forward pipe operator's documentation

2021-06-19 Thread Gabor Grothendieck
These also work in this particular case although not in general and the Call: line in the output differs: mtcars |> subset(cyl == 4) |> with(lm(mpg ~ disp)) mtcars |> with(lm(mpg ~ disp, subset = cyl == 4)) On Sat, Jun 19, 2021 at 7:23 AM Erez Shomron wrote: > > Hello, > > > While playing

[Rd] Additional an example for the forward pipe operator's documentation

2021-06-19 Thread Erez Shomron
Hello, While playing around with the new forward pipe operator I've noticed there's a possibly overlooked usage for the operator, which would be very beneficial to document. Whenever you want the LHS to be passed to an argument other than the first, the documented example demonstrates how