I am well aware of how to have roxygen not run an example when the code is directly in the roxygen comments. However, some example may be somewhat verbose or you would want you examples compiled in an examples directory. In which case the @example file_path
works fine but I can't figure out how to have roxygen not run (i.e. \dontrun
) the example file.
This is admitted very similar to this question but the comments show that this problem was not answered.
test.R
# this does not work
#' @title test_fun
#' @example \dontrun{examples/test_example.R}
test <- function(){
print("hello")
}
# this does
#' @title test
#' @examples
#' \dontrun{
#' test()
#' }
test <- function(){
print("hello")
}
test_example.R
test()
How can I get the former approach to work?
--no-examples
– Tufthunter