I included support for the formula notation if rlangis installed, it fails explicitly if users try to use formula notation and and rlangis not installed. I can easily remove it.
My package uses the argument format_fun in its functions but I named it formatfun here to be more consistent with other argument names.
It was quite straightforward to do, the main challenge is that the "digits" argument is taken, and used through options througout the function, to be able to use it in all formatting functions I used :
Following my conversation with Pr. Harrell by email
I included support for the formula notation if
rlang
is installed, it fails explicitly if users try to use formula notation and andrlang
is not installed. I can easily remove it.My initial reason for this was to be able to use my function
format_metric
:My package uses the argument
format_fun
in its functions but I named itformatfun
here to be more consistent with other argument names.It was quite straightforward to do, the main challenge is that the "digits" argument is taken, and used through
options
througout the function, to be able to use it in all formatting functions I used :(
names(formals(args(formatfun)))))
rather thanformalArgs(formatfun)
to handle primitives.and then replaced the relevant calls to format, .e.g :
flow <- format(low)
becomesflow <- do.call(formatfun, c(list(low), format.args))