So I'm trying to use roxygen2 to document my code. Unfortunately my supervisor felt it was cluttered having so many functions in the global environment. So I've been told to hide them away in sub environments. This seems to be stopping roxygen detecting them correctly. Minimal example below.
my_env <- new.env()
#' test
#'
#' more test
#'
#' @return none
my_env$my_func <- function(){}
environment(my_env$my_func) <- my_env
I'm using the Document() command in devtools to build the documentation. However I just keep getting the error "Warning: min_examp.R:8: Missing name". Given I don't think I'm going to be allowed to put the functions back the way they were before hiding them does anyone have any suggestions about how to get roxygen to detect my functions?
roxygen2
can't find the name of your function.
Provide a name to your function like so
#' @name name_of_your_function
I was finally able to fix this by doing the following
my_env <- new.env()
#' my title
#'
#' @name my_env$my_func
#'
#' @usage my_env$my_func()
#'
#' more test
#'
#' @return none
my_env$my_func <- function(){}
environment(my_env$my_func) <- my_env
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With