library("reposr")
We will use the following directory as our local CRAN-like package repoitory:
root <- file.path(tempdir(), "cran")
repo <- PackageRepository$new(root)
repo$ensure()
repo$exists()
(getOption("repos")) repo$register() (getOption("repos"))
repo$browse()
repo$buildInto()
Show content based on index file:
repo$show() repo$show(type = "source") repo$show(type = "mac.binary") repo$show(type = "win.binary")
Check if specific package(s) exist(s):
repo$has() repo$has(type = "source", atomic = FALSE) repo$has(c("devtools", "dplyr"))
Remove outdated packages and refresh. Outdated packages are moved to an
special repository archive repo$root_atomic
.
Each outdated package build will be integrated into its own "one-package-only" repository: file.path(repo$root_atomic, "<pkg_name>", "<pgk_version>")
repo$clean()
Remove packages:
repo$remove() repo$remove("<pkg_name>")
Reset entire repository:
repo$reset()
repo$exists() repo$delete() repo$exists()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.