The public hello.world package is a small example you can install to try rrepo.
Choose your package manager below. You do not need an account or an API key.
rpx uses https://rrepo.dev/rrepo/hello-world. R, rv, and renv use
https://cran.rrepo.dev/rrepo/hello-world. CRAN-compatible indexes live on the
cran.rrepo.dev subdomain to keep them separate from the interface used by rpx.
Both addresses serve the same repository.
Keep CRAN configured alongside your rrepo repository so your package manager can also install public dependencies.
rpx
In your rpx project, add the repository and install the package:
rpx repo add https://rrepo.dev/rrepo/hello-world
rpx add hello.world
Your default CRAN source remains configured.
R
Run this in your R session:
install.packages(
"hello.world",
repos = c(
rrepo = "https://cran.rrepo.dev/rrepo/hello-world",
CRAN = "https://cloud.r-project.org"
)
)
rv
In your rv project, add the repository and install the package:
rv configure repository add rrepo --url https://cran.rrepo.dev/rrepo/hello-world
rv add hello.world --repository rrepo
renv
In your renv project, include the repository when installing:
renv::install(
"hello.world",
repos = c(
rrepo = "https://cran.rrepo.dev/rrepo/hello-world",
CRAN = "https://cloud.r-project.org"
)
)
Run renv::snapshot() when you are ready to record your project's package versions.
Use the installed package
Run this in the R environment where you installed the package:
hello.world::hello_world()
#> [1] "Hello, world!"
Use your own repository
Replace rrepo/hello-world in the commands with your organization and repository
slugs, and replace hello.world with the package you want to install.
For a private repository, follow Private packages to configure credentials before installing.
To list available source packages using R:
available.packages(
repos = "https://cran.rrepo.dev/rrepo/hello-world",
type = "source"
)[, c("Package", "Version"), drop = FALSE]