It would be nice to have the keep argument on mutate functions that Dplyr has. From their docs:
.keep
Control which columns from .data are retained in the output. Grouping columns and columns created by ... are always kept.
"all" retains all columns from .data. This is the default.
"used" retains only the columns used in ... to create new columns. This is useful for checking your work, as it displays inputs and outputs side-by-side.
"unused" retains only the columns not used in ... to create new columns. This is useful if you generate new columns, but no longer need the columns used to generate them.
"none" doesn't retain any extra columns from .data. Only the grouping variables and columns created by ... are kept.
Using myself as an example, I often find I need to create temporary working columns that I need to break up the computations to keep it readable. In those cases, keep: :none or keep: :used options really help. Especially in Livebook mode where readability trumps performance.
I am currently chaining mutate with select and it's fine, but it's a bit of work to keep them aligned with the number of mutations gets large. Being able to avoid this would be nice.
A PR that supports :all and :none would be welcome. We can support others but those are the easier ones to get started with. The implementation can be a simple call to select. :)
It would be nice to have the
keep
argument onmutate
functions that Dplyr has. From their docs:Using myself as an example, I often find I need to create temporary working columns that I need to break up the computations to keep it readable. In those cases,
keep: :none
orkeep: :used
options really help. Especially in Livebook mode where readability trumps performance.I am currently chaining
mutate
withselect
and it's fine, but it's a bit of work to keep them aligned with the number of mutations gets large. Being able to avoid this would be nice.