This function serves as an example for how a risk score might be derived. Assuming all assessments provided by riskmetric are available in a dataset, this function can be used to calculate a vector of risks.

summarize_scores(data, weights = NULL)

Arguments

data

a tibble of scored assessments whose column names match those provided by riskmetric's pkg_assess function.

weights

an optional vector of non-negative weights to be assigned to each assessment.

Value

a numeric vector of risk scores

Examples

if (FALSE) {
library(dplyr)
summarize_scores(pkg_score(pkg_assess(as_tibble(pkg_ref("riskmetric")))))

library(dplyr)
pkg_ref("riskmetric") %>%
  pkg_assess() %>%
  pkg_score() %>%
  summarize_scores()
}