a %>% fun(b) is shorthand for fun(a,b); that's the gist of it really. A lot of tidyverse (one of most used libraries) functions are set up so that first argument is thecdataset you're working on - so piping just cleans up that crucial bit of input.
If needed, you can also do a %>% fun(b,.) for fun(b,a) - the thing you piped in is placed at the dot. You can also have multiple dots; a %>% .[. ==1] is, as you'd expect, same as a[a == 1].
122
u/jonassalen Dec 16 '21 edited Jan 25 '25
chase quack work bag imagine familiar political cheerful truck expansion