While most installations take place in the default library, users are
able to specify custom library paths for each installed package. Thus
the task of collecting metadata for all locally available packages is
slightly less trivial, especially if the user wishes to take into
consideration only a subset of locally existing libraries. In any case,
the key function to remember is .libPaths()
as it provides
the user with paths of the currently attached libraries.
Packages
To list all packages installed to a selected library (or libraries)
the user should use wood_local_packages()
.
wood_local_packages() |>
print(max = 10)
#> [1] "_cache" "askpass" "base64enc" "brio" "bslib" "cachem"
#> [7] "callr" "cli" "clipr" "covr"
#> [ reached getOption("max.print") -- omitted 69 entries ]
Available package versions
To list all versions of a package installed to selected libraries the
user should use wood_local_versions()
. Note that the
“versions” are plural, as it is possible to install more than one
version of a package, each to a different library.
wood_local_versions("versionsort", paths = "all")
#> [1] "1.1.0"
Package dependencies
To list package dependencies the user should use
wood_local_dependencies()
. Hopefully all Imports are
installed too!
wood_local_dependencies("versionsort", paths = "all")
#> <dependencies>
#> Suggests: covr
#> Suggests: spelling
#> Suggests: testthat (>= 3.0.0)