R Roxygen2: How to document a function generated by another function?
In my package, I wrote a functional that takes a function as input and creates another function. How can I document a function created with a procedure like this?
Below is an illustration: use a function to convert sin()
(which takes a radian input) to sind()
which takes input in degree units.
rad2deg <- function(f) {
force(f)
function(x) f(x / 180 * pi)
}
Here is some documentation for the function below ...
sind <- rad2deg(sin)
rad2deg
- this is just my service functionality, used only by me and, therefore, not exported and not documented. I need to export sind
. But I have no idea how this can be done as it is not even recognized as a function, and it does not even have an explicit argument (of course it takes a function argument implicitly sin
). Thus, even the tag @param
cannot be used.
Does anyone have any ideas?
source to share