Check package dependencies
checkDependencies(repo, dependencyType = c("Imports", "Depends"), nThreads = 1)
(Repository
)
Repository object.
(character()
)
Types of dependencies to be included
(numeric(1)
: 1)
Number of threads to use to fetch permitted packages
Data frame with all the packages that are now permitted.
column | data type |
package | character() |
version | character() |
# \donttest{
# Set cahce, usually not required.
withr::local_envvar(
R_USER_CACHE_DIR = tempfile()
)
fetchedRepo <- tryCatch(
{
# Set dir to clone repository to.
tempDir <- tempdir()
pathToRepo <- file.path(tempDir, "glue")
# Clone repo
git2r::clone(
url = "https://github.com/tidyverse/glue.git",
local_path = pathToRepo
)
# Create instance of Repository object.
repo <- PaRe::Repository$new(path = pathToRepo)
# Set fetchedRepo to TRUE if all goes well.
TRUE
},
error = function(e) {
# Set fetchedRepo to FALSE if an error is encountered.
FALSE
},
warning = function(w) {
# Set fetchedRepo to FALSE if a warning is encountered.
FALSE
}
)
#> cloning into 'C:\Users\MVANKE~1\AppData\Local\Temp\RtmpMLHGjE/glue'...
if (fetchedRepo) {
# Use checkDependencies on the Repository object.
checkDependencies(repo)
checkDependencies(repo, dependencyType = c("Imports", "Suggests"))
}
# }