Closed millermc38 closed 2 years ago
This behaviour is consistent with the non-magrittr form and is due to lazy evaluation.
Use %!>%
to evaluate eagerly. See documentation and examples in https://magrittr.tidyverse.org/reference/pipe-eager.html for more about this behaviour.
By simply changing the argument order in the join step, I can get the code below to run. I just installed the most recent version of Tidyverse as of this post (1.3.1), and I'm using R version 4.1.1 (2021-08-10), "Kick Things". If you run the the pipe without join statment, the assignment works fine (odd). When I tested on a different machine, I had an old version of the tidyverse (which I foolishly did not record), and the code would run. Now it does not with the latest version of tidyverse. R version on the other machine is 3.6.3 (2020-02-29).
Update: Sorry to cross post, but as soon as I learned it was a version issue, I moved this questions from Stack Overflow to here. However, someone on Stack Overflow pointed out that if you make the code below without pipes, the result makes perfect sense. However, I think this is not what the user expects. They expect the operations to be processed in the order of the piping. So really, this is not a bug but a feature request.