R uses binary database format for installed packages to pack the objects into a database-alike file format for efficiency reasons (lazy loading). These database files (*.rdb
and *.rdx
) are stored in the R sub folder of the package installation path (see ?lazyLoad
).
Even if
- you are looking at the right place to find the installed package (use
.libPaths()
in R to find the installation folder)
- and you have installed the package with the source code (like you did or
via
install.packages("a_CRAN_package", INSTALL_opts = "--with-keep.source")
)
you will not find R files in R folder there.
You can verify that the source code is available by picking one function name from the package and print it on the console. If you can see the source code (with comments) the package sources (R files) are available:
print(DeSeq2::any_function)
To make the source code available for debugging and stack traces you can set the option keep.source.pkgs = TRUE
(see ?options
) in your .Rprofile
file or via an environment variable:
keep.source.pkgs:
As for keep.source, used only when packages are
installed. Defaults to FALSE unless the environment variable
R_KEEP_PKG_SOURCE is set to yes.
Note: The source code is available then only for newly installed and updated packages (not for already installed packages!).
For more details see: https://yetanothermathprogrammingconsultant.blogspot.de/2016/02/r-lazy-load-db-files.html