.R
files in the R
directory and optionally includes files from the tests
directory.
It can also exclude roxygen2 documentation lines.Helper function to extract code from package source files.
This function reads all .R
files in the R
directory and optionally includes files from the tests
directory.
It can also exclude roxygen2 documentation lines.
extract_code_source(pkg_path, include_tests = FALSE, include_roxygen = FALSE)
A single string containing the source code from the package's R files.
Path to the package source directory.
logical
. If TRUE
, for non-installed packages, the function will also include R source code from the tests
directory. Defaults to FALSE
.
logical
. If TRUE
, roxygen2 documentation lines (lines starting with "#'") from R files will be included in the output. Defaults to FALSE
.