Skip to contents

List the packages a collection uses

Usage

collection_packages(path = ".")

Arguments

path

The collection, or any directory inside it.

Value

A webrarian_packages data frame with one row per configured package, with columns package and source ("prebuilt", "github" or "local"). It has zero rows when no package is configured. check_inventory() says which of them webR can install.

Examples

collection <- file.path(tempdir(), "webrarian-packages-demo")
catalog(collection, packages = c("dplyr", "ggplot2"))
#> ✔ Created directory /tmp/RtmpQU25pJ/webrarian-packages-demo
#> ✔ Created _webrarian.yml
#> ✔ Added "_site/" and ".webrarian/" to .gitignore
#> ✔ Cataloged webrarian collection: "webrarian-packages-demo"
#> 
#> Next steps:
#>   Move into the collection: `setwd("/tmp/RtmpQU25pJ/webrarian-packages-demo")`
#>   Acquire packages: `webrarian::acquire_package("dplyr")`
#>   Acquire files: `webrarian::acquire_file("data/")`
#>   Bind: `webrarian::bind()`
#>   Reading room: `webrarian::reading_room()`
#> ℹ Or pass `path` to each call, e.g. `webrarian::bind(path =
#>   "/tmp/RtmpQU25pJ/webrarian-packages-demo")`
collection_packages(collection)
#> 
#> ── Webrarian Packages ──────────────────────────────────────────────────────────
#> 
#> ── prebuilt ──
#> 
#> • dplyr
#> • ggplot2

unlink(collection, recursive = TRUE)