View source: R/prune-runtime.R
| prune_bundled_r_runtime | R Documentation |
Shrinks a bundled R runtime by deleting files that a running app does not read. The removed names form a fixed allowlist; everything else is kept.
prune_bundled_r_runtime(runtime_dir, verbose = TRUE)
runtime_dir |
Character. The embedded |
verbose |
Logical. Whether to report what was removed. |
The allowlist covers:
From every installed package, both in the bundled library
(runtime/R/library) and among the base and recommended packages in the
portable R's own library: the test suites in tests/, testme/ and
tinytest/.
From each portable R distribution (runtime/R/portable-r-*): R's
regression tests in tests/, and inside doc/ the html/ and manual/
directories plus R's news, FAQ, CHANGES and README files.
Package examples/, demo/, NEWS and CHANGELOG files and include/
headers are kept, because some packages and apps read them at runtime (for
example shinyjs::runExample(), a "What's new" panel that shows NEWS.md
via system.file(), or Rcpp::sourceCpp()). In the portable R's doc/,
COPYING, COPYRIGHTS (third-party notices that binary distributions of R
must include), AUTHORS, THANKS, RESOURCES, the mirror lists read by
utils::getCRANmirrors() and the KEYWORDS files are kept.
Symbolic links are never followed: a link is removed itself, and its target is neither touched nor counted. The totals count only the regular files that are actually gone afterwards.
Invisibly, a list with the number of files and bytes removed.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.