I have a question about the "roxygen2" package:
I have seen a lot of tutorials that make use of it for package documentation (such as the major "object documentation" page by Hadley Wickham)
So what if I do have R code that is not a package, say an R project? Can you document R Projects with roxygen2 as well?
I was still able to run the
package.skeleton(name='RoxygenSkeleton', code_files = "Roxygen.R", force=TRUE)
function to create the basic package structure and .Rd files were created. But I would desire a nice output in HTML or PDF...
As explained elsewhere, as of roxygen2 6.0, the following works to parse documented R source files outside packages.
source_env = roxygen2::env_file(sourcefile)
rd_blocks = roxygen2::parse_file(sourcefile, source_env)
help_topics = roxygen2::roclet_process(roxygen2::rd_roclet(), rd_blocks, source_env, dirname(sourcefile))
rd_code = lapply(help_topics, format)
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