PlotFlower: Flower plots for OHI scores By Casey O'Hara, Julia Lowndes,...

View source: R/PlotFlower.R

PlotFlowerR Documentation

Flower plots for OHI scores By Casey O'Hara, Julia Lowndes, Melanie Frazier github.com/ohi-science Assumes the following is present:

Description

* A csv file of scores (typically, scores.csv) generated by the calculate_score.R script. * An updated conf/goals.csv file. This file provides a list of goals/subgoals and the goal/subgoal names used for plotting * Optional: A data layer called layers/fp_wildcaught_weight.csv that is used to weight the contribution of the fisheries and mariculture subgoals to the food provision goal; this information determines the relative width of these two subgoals in the flowerplot; if not available, these subgoals will have equal widths.

Usage

PlotFlower(
  region_plot = NA,
  year_plot = NA,
  assessment_name = "Average",
  scenario_folder = "eez",
  scores_file = "scores.csv",
  dir_fig_save = file.path(scenario_folder, "reports/figures"),
  legend_include = TRUE,
  save = TRUE
)

Arguments

region_plot

region_id/s to plot (i.e., region_plot = c(1,4,8)), defaults to plotting all regions plus the weighted average of all regions

year_plot

scenario year to plot if there are multiple scenario years in scores.csv; if not provided, defaults to most recent year

assessment_name

this is the name that will be given to the weighted average of all regions (i.e., region_id=0, usually something like: "Global Average")

Value

png file/s of flowerplots will be saved in the dir_fig_save location; an additional regions_figs.csv file will be saved that describes region_id, region_name, and file paths to flower_.png files.


OHI-Science/ohicore documentation built on Dec. 10, 2023, 5:45 a.m.