riskmetric R Package

repository·master·Indexed 41 days ago

https://github.com/pharmar/riskmetric

A collection of risk metrics for evaluating R package quality based on development best practices, documentation, community engagement, and sustainability. It provides a three-step pipeline using pkg_ref(), pkg_assess(), and pkg_score() to derive risk scores. Currently in a maintenance-only lifecycle as development shifts to the val.meter tool.

Tokens
526
Snippets
3
Records
4
Agent score
1%

What's inside riskmetric

  1. Overview of the {riskassessment} application

    master

    The {riskassessment} package is a Shiny-based front-end that extends riskmetric. It provides an organizational hub to review and assess R package risks using a local database.

    Key features include:

    • Storing and displaying all riskmetric metrics and package risk scores over time.
    • Managing organization-wide metric weighting and automated decision rules (e.g., whether to endorse or prohibit a package).
    • Facilitating communication through package-level user dialogue regarding perceived risk.
  2. How the risk assessment workflow works

    master

    The riskmetric workflow for assessing the risk of an R package follows a three-step pipeline:

    1. pkg_ref(): Find a source for package information (either an installed package or a CRAN/git source).
    2. pkg_assess(): Assess the package against specific validation criteria.
    3. pkg_score(): Score the assessment criteria to produce risk metrics.

    The final output is a dataset containing validation criteria and an overall risk score for each package.

    library(dplyr)
    library(riskmetric)
    
    # Example workflow
    pkg_ref(c("riskmetric", "utils", "tools")) %>%
      pkg_assess() %>%
      pkg_score()
  3. Estimate package risk with a pipeline

    master

    To estimate the risk of one or more packages, use the piped workflow combining pkg_ref(), pkg_assess(), and pkg_score(). This allows you to scrape metadata (locally or remotely), assess it, and derive composite risk measures or individual scores for validation reports.

    library(dplyr)
    library(riskmetric)
    
    pkg_ref(c("riskmetric", "utils", "tools")) %>%
      pkg_assess() %>%
      pkg_score()