Dump source code, documentation and vignettes of an R
package into a single file. Supports installed packages,
tar.gz
archives, and package source directories. If the
package is not installed, only its source is automatically downloaded
from CRAN for processing. The output is a single plain text file or a
character
vector, which is useful to ingest complete
package documentation and source into a large language model (LLM) or
pass it further to other tools, such as
{ragnar}
to create a
Retrieval-Augmented Generation (RAG) workflow.
Install the latest stable release of rdocdump
from CRAN
with:
install.packages("rdocdump")
You can install the development version of rdocdump
from
R Universe with:
install.packages('rdocdump',
repos = c('https://e-kotov.r-universe.dev', 'https://cloud.r-project.org')
)
or from GitHub with:
# install.packages("pak")
::pak("e-kotov/rdocdump") pak
Extract documenation and source code of {rJavaEnv}
package by downloading source from CRAN and save it to file
rJavaEnv_docs.txt
rdd_to_txt(
pkg = "rJavaEnv",
file = "rJavaEnv_docs.txt",
force_fetch = TRUE, # force download even if package is installed
keep_files = "none" # delete temp files
)
To cite package ‘rdocdump’ in publications use:
Kotov E (2025). rdocdump: Dump R Package Source, Documentation, and Vignettes into One File. doi:10.32614/CRAN.package.rdocdump https://doi.org/10.32614/CRAN.package.rdocdump, https://github.com/e-kotov/rdocdump.
BibTeX:
@Manual{rdocdump,
title = {rdocdump: Dump R Package Source, Documentation, and Vignettes into One File},
author = {Egor Kotov},
year = {2025},
url = {https://github.com/e-kotov/rdocdump},
doi = {10.32614/CRAN.package.rdocdump},
}