Package 'riskassessment'

Title: A web app designed to interface with the `riskmetric` package
Description: A shiny application that allows users to define a list of R packages to assess metrics engineered by the `riskmetric` package. In general, those metrics evaluate package development best practices, code documentation, community engagement, and sustainability that culminate in a quantitative risk score. The app allows users to select and review one package at a time to consume interactive visuals, download reports for sharing, submit comments for group collaboration, and even tweak metric weights used to calculate the packages' risk scores. When deployed in the context of an organization, the app serves as a platform for package validation, offering an authentication wall where roles are assigned to various users and 'final decisions' can be made at the package level manually or through pre-defined automation rules.
Authors: Aaron Clark [aut, cre], Jeff Thompson [aut] (Co-Lead), Robert Krajcik [aut], Lars Andersen [aut], Andrew Borgman [aut], Munshi Imran Hossain [ctb], Scott Schumacker [ctb], Marly Gotti [aut], Maya Gans [aut], Aravind Reddy Kallem [aut], Eduardo Almeida [ctb], Narayanan Iyer [ctb], Fission Labs India Pvt Ltd [aut], PSI special interest group Application and Implementation of Methodologies in Statistics [cph, fnd], R Validation Hub [cph, fnd], GSK contributors [ctb] (Author of 'pharmaR/pkg_explorer' repo), Appsilon [ctb]
Maintainer: Aaron Clark <[email protected]>
License: MIT + file LICENSE
Version: 3.1.1
Built: 2024-11-03 05:40:05 UTC
Source: https://github.com/pharmaR/riskassessment

Help Index


Build a plotly of community usage metrics

Description

Responsible for building an interactive {plotly} graphic containing the trend line for number of CRAN pkg downloads by month.

Usage

build_comm_plotly(data = NULL, pkg_name = NULL)

Arguments

data

a data.frame containing monthly download data, built using generate_comm_data(). This argument is optional, but if NULL, a pkg_name must be provided.

pkg_name

a string of a package name. This parameter is optional. If pkg_name is provided, the data argument should be NULL.

Value

a plotly object

an interactive plotly object

Example

  build_comm_plotly(pkg_name = "ggplot2")

Example Output

build_comm_plotly_ex2.png


Generate Community Usage Data

Description

Extracts community usage metrics for a given package.

Usage

generate_comm_data(pkg_name)

Arguments

pkg_name

A string containing the name of a package.

Value

A tibble of community usage metrics

a data.frame which includes downloads per month for the given pkg

Examples

if( interactive()) {
ggplot_comm_df <- generate_comm_data("ggplot2")
head(ggplot_comm_df)
}

Initialize riskassessment Application Settings

Description

This sets up the environment when running the riskassessment Application. It sets the log file, initializes the package database if missing, and initializes the credentials database if missing.

Usage

initialize_raa(assess_db, cred_db, configuration)

Arguments

assess_db

A string denoting the name of the assessment database.

cred_db

A string denoting the name of the credentials database.

configuration

a list dictating the configuration of the databases

Value

There is no return value. The function is run for its side effects.


Run the Shiny Application

Description

Run the Shiny Application

Usage

run_app(
  onStart = initialize_raa,
  options = list(),
  enableBookmarking = NULL,
  uiPattern = "/",
  app_ver = NULL,
  login_note = NULL,
  ...
)

Arguments

onStart

A function that will be called before the app is actually run. This is only needed for shinyAppObj, since in the shinyAppDir case, a global.R file can be used for this purpose.

options

Named options that should be passed to the runApp call (these can be any of the following: "port", "launch.browser", "host", "quiet", "display.mode" and "test.mode"). You can also specify width and height parameters which provide a hint to the embedding environment about the ideal height/width for the app.

enableBookmarking

Can be one of "url", "server", or "disable". The default value, NULL, will respect the setting from any previous calls to enableBookmarking(). See enableBookmarking() for more information on bookmarking your app.

uiPattern

A regular expression that will be applied to each GET request to determine whether the ui should be used to handle the request. Note that the entire request path must match the regular expression in order for the match to be considered successful.

app_ver

a "global" variable that is passed to several modules & reports which details the installed package version when not specified. It can be overwritten to include a specific version name as a text string.

login_note

a text string to display underneath the auth screen's login button, provided to guide users

...

arguments to pass to golem_opts. See ?golem::get_golem_options for more details.

Value

a shiny app object


Upload a Package List

Description

Uploads a list of packages to the database. Designed to be used to set up the assessment database before deployment of the application.

Usage

upload_pkg_lst(
  pkg_lst,
  assess_db,
  repos,
  repo_pkgs,
  user_name = "system",
  updateProgress = NULL
)

Arguments

pkg_lst

character vector of packages to upload

assess_db

character name (and file path) of the database

repos

character vector, the base URL(s) of the repositories to use

repo_pkgs

for internal use only, allows the function available.packages() to be run only once

user_name

character name of user

updateProgress

for internal use only, provides a function to update progress meter in the application

Value

A data frame object containing a summary of the upload process