### Demo with example output from the risk() function based on expert scores
# (where direct and direct/indirect effects were evaluated)
# Calculate mean risks scores per indicator/pressure/ecosystem:
mean_risk <- aggregate_risk(
risk_results = ex_output_risk_expert,
method = "mean" # default
)
mean_risk
# Calculate median risks scores:
aggregate_risk(
risk_results = ex_output_risk_expert,
method = "median"
)
# Calculate maximum risks scores:
aggregate_risk(
risk_results = ex_output_risk_expert,
method = "maximum"
)
### Demo with example output from the risk() function based on modelled
# scores (where only direct/indirect effects were evaluated)
# Calculate mean risks scores:
aggregate_risk(risk_results = ex_output_risk_model)
### Demo with combined expert-based and model-based pathways
combined_risk <- rbind(ex_output_risk_expert, ex_output_risk_model)
aggr_risk <- aggregate_risk(risk_results = combined_risk)
aggr_risk
aggr_risk$multi_indicator_risk |>
dplyr::filter(type == "combined", pathway == "combined")
aggr_risk$multi_pressure_risk |>
dplyr::filter(type == "combined", pathway == "combined")
aggr_risk$ecosystem_risk |>
dplyr::filter(type == "combined", pathway == "combined")
### Demo with vulnerability scores using example output data from
# vulnerability() based on modelled scores
aggregate_risk(risk_results = ex_output_vulnerability_model)
Run the code above in your browser using DataLab