Intent: Capture arrange specification in a variable and pass to dplyr::arrange.
Here is a function signature I am trying to implement:
use_orderby_spec(df, orderby_spec, ...)
Note that ...
is reserved for something else.
Here is the expected usage,
use_orderby_spec(iris, c(Species, desc(Sepal.Width)))
which essentially should translate to
dplyr::arrange( iris, Species, desc(Sepal.Width) )
Observations:
-
Solutions seems to revolve around using
...
. In my case,...
is used for something else. -
pick
seems to be helpful cases where arrange is column names as expressions and not the ones withdesc(colname)
.