Skip to contents

assess package for risk metrics

Usage

assess_pkg(pkg_source_path, rcmdcheck_args, covr_timeout = Inf)

Arguments

pkg_source_path

- source path for install local

rcmdcheck_args

- arguments for R Cmd check - these come from setup_rcmdcheck_args

covr_timeout

- setting for covr time out

Value

list containing results - list containing metrics, covr, tm - trace matrix, and R CMD check

Examples

if (FALSE) { # \dontrun{
library(risk.assessr)
# set CRAN repo to enable running of reverse dependencies
r = getOption("repos")
r["CRAN"] = "https://cloud.r-project.org"
options(repos = r)

pkg_source_path <- file.choose()
pkg_name <- sub("\\.tar\\.gz$", "", basename(pkg_source_path)) 
modified_tar_file <- modify_description_file(pkg_source_path)

# Set up the package using the temporary file
install_list <- risk.assessr::set_up_pkg(modified_tar_file)

# Extract information from the installation list
build_vignettes <- install_list$build_vignettes
package_installed <- install_list$package_installed
pkg_source_path <- install_list$pkg_source_path
rcmdcheck_args <- install_list$rcmdcheck_args

# check if the package needs to be installed locally
package_installed <- 
  risk.assessr::install_package_local(pkg_source_path)

# Check if the package was installed successfully
if (package_installed == TRUE) {
  # Assess the package
  assess_package <- risk.assessr::assess_pkg(pkg_source_path, rcmdcheck_args)
  # Output the assessment result
} else {
  message("Package installation failed.")
}
} # }