Learn R Programming

risk.assessr (version 3.0.1)

assess_pkg_r_package: Assess an R Package riskmetric with package name and version

Description

This function use `risk.assessr::assess_pkg` assessment function with only the package name and version

Usage

assess_pkg_r_package(package_name, version = NA, repos = NULL)

Value

The function returns a list of assessment results generated by the `risk.assessr::assess_pkg` function. If the package cannot be downloaded or installed, an error message is returned.

Arguments

package_name

A character string specifying the name of the package to assess.

version

A character string specifying the version of the package to assess. Default is `NA`, which assesses the latest version.

repos

A character string specifying the repo directly. Default is NULL, which uses the mirrors

Details

This function follows these steps:

  1. Downloads the specified R package

  2. Installs the downloaded package in a temporary location.

  3. Runs the `risk.assessr::assess_pkg` function to assess the package for risks and issues.

  4. Returns the results of the assessment.

Examples

Run this code
# \donttest{
r <- getOption("repos")
# save current repo options  
old <- options(repos = r)
r["CRAN"] = "http://cran.us.r-project.org"
options(repos = r) 

results <- assess_pkg_r_package("here", version = "1.0.1")

# restore user's repo options
options(old)

print(results)
# }

Run the code above in your browser using DataLab