Open moodymudskipper opened 4 years ago
or an after()
/before()
set of pseudo functions ?
It would work a bit like s()
but with a first argument for position :
mtcars %tb>% .[after(disp, foo = cyl)]
I think it makes a lot of sense, it just adds magical functions.
tb recognizes that after and before cannot be called in i and j, so feeds them to the ...
Reordering can be done in
j
usings()
, but maybe we can mutate at some position ?@
is used for slots so could be used unambiguously. The parser is flexible enough so that1@.(2)
is legal, though1@2
and1@(2)
are not.This could mutate Species and place it before Sepal.Length :
This could just move it
Move everything starting with a before anything numeric :
This deals with before, not after.
Another possible syntax
This makes
<
and>
special though, and could lead to ambiguities if it were used to get a logical index, but I don't see an example when we'd want that. maybe something like : apply this transformation on columns with low nchar ?I don't know how intuitive this is however so let's let it rest