Description Usage Arguments Examples
This function contains a complete set of functionality to plot the formal plot types required for an Management Strategy Evaluation Analysis
1 2 3 4 5 | PlotMSE(func_group_name = NULL, fleet_group_name = NULL, plot_width_inches,
plot_height_inches, y_value_label, x_value_label, plot_title = NULL,
units = "", n_label_cols, yearly_in_filename, results_folder_path,
save_plot_folder, fleet_lookup_file = NULL, total_area = NULL,
scale_unit = 1, wrangle_function = NULL, plot_type_fun, ...)
|
func_group_name |
If required, the functional group name to be plotted |
fleet_group_name |
If required, the fleet group name to be plotted |
plot_width_inches |
The number of inches wide for the produced plot |
plot_height_inches |
The number of inches high for the produced plot |
y_value_label |
The y-axis label for the plot |
x_value_label |
The x-axis label for the plot |
plot_title |
Optional The plot title |
units |
The units of the y-axis |
n_label_cols |
The number of columns that label the data before the actual numeric values, contained in the csv being plotted |
yearly_in_filename |
Logical value representing whether the csv file to plot contains in the title the word yearly |
results_folder_path |
The path to the folder that contains the csv file being plotted |
save_plot_folder |
The path to the plots folder which will contain folders for each plot type and inside them the plots created using this function |
fleet_lookup_file |
Contains the path and filename for the fleet lookup file. The first row contains headers for: Column1 = Fleet name, Column2 = Fleet Number This is used when the file names don't contain the fleet name but FleetNoX. It converts from the fleet name to FleetX |
total_area |
The total area covered by the model |
scale_unit |
Used to scale the units, so if you want to convert from tons to kilo tons set to 1000 |
wrangle_function |
Set to the type of data manipulation you want depending on the plot you are creating WrangleBoxplotMean WrangleBoxplotProbability WrangleBoxplotAAV WrangleTimeseriesAnnualChange |
plot_type_fun |
the choice of two types of plots, PlotTimeseries or PlotBoxplot |
... |
If you are using WrangleBoxplotProbability set the argument bref |
true_year_beginning |
The actual date year that is the start of the simulation |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | plots_folder <- "C:/Users/Mark/Desktop/Plots/"
results_folder <- "C:/Users/Mark/Box Sync/Baltic - Stockholm/Results-and-plots-2017-09-08/Results/"
fleet_lookup_table <- "C:/Users/Mark/Desktop/Plots/FleetNameLookupTable.csv"
#Boxplot-AAV-catch
PlotMSE(
func_group_name = "AdCod", fleet_group_name = "AllFleets",
start_year = 1, end_year = 19,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "AAV Catch", x_value_label = "Strategy",
units = "%",
n_label_cols = 5,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "CatchTrajectories/"),
fleet_lookup_file = fleet_lookup_table,
save_plot_folder = plots_folder,
wrangle_function = WrangleBoxplotAAV,
plot_type_fun = PlotBoxplot
)
#Boxplot-AAV-SSB
PlotMSE(
func_group_name = "AdCod",
start_year = 1, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "AAV SSB", x_value_label = "Years",
units = "%",
n_label_cols = 4,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "Biomass/"),
save_plot_folder = plots_folder,
wrangle_function = WrangleBoxplotAAV,
plot_type_fun = PlotBoxplot
)
#Boxplot-biomass
PlotMSE(
func_group_name = c("JuvCod"),
start_year = 1, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "Biomass", x_value_label = "Strategy",
units = "kt",
n_label_cols = 4,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "Biomass/"),
save_plot_folder = plots_folder,
total_area = 240000,
scale_unit = 1000,
wrangle_function = WrangleBoxplotMean,
plot_type_fun = PlotBoxplot
)
#Boxplot-catch
PlotMSE(
func_group_name = "AdCod", fleet_group_name = "AllFleets",
start_year = 1, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "Average Catch", x_value_label = "Strategy",
units = "kt/yr",
n_label_cols = 5,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "CatchTrajectories/"),
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
total_area = 240000,
scale_unit = 1000,
wrangle_function = WrangleBoxplotMean,
plot_type_fun = PlotBoxplot
)
#Boxplot-effort
PlotMSE(
fleet_group_name = "ACT0018",
start_year = 25, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "Effort", x_value_label = "Strategy",
units = "",
n_label_cols = 4,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "Effort/"),
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
wrangle_function = WrangleBoxplotMean,
plot_type_fun = PlotBoxplot
)
#Boxplot-prob-bref
PlotMSE(func_group_name = "AdCod",
start_year = 24, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "Probability", x_value_label = "Strategy",
units = "",
n_label_cols = 4,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "Biomass/"),
save_plot_folder = plots_folder,
total_area = 240000,
scale_unit = 1000,
wrangle_function = WrangleBoxplotProbability,
plot_type_fun = PlotBoxplot,
bref = 100, plot_title = "Risk: P(SSB < Blim)"
)
#Boxplot-realisedF
PlotMSE(func_group_name = "AdCod",
start_year = 0, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "Realised F", x_value_label = "Strategy",
units = "/km2/yr",
n_label_cols = 5,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "RealisedF/"),
save_plot_folder = plots_folder,
wrangle_function = WrangleBoxplotMean,
plot_type_fun = PlotBoxplot
)
#Boxplot-TAC
PlotMSE(func_group_name = "AdCod", fleet_group_name = "AllFleets",
start_year = 5, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "TAC", x_value_label = "Strategy",
units = "kt",
n_label_cols = 5,
yearly_in_filename = FALSE,
results_folder_path = paste0(results_folder, "HCRQuota_Targ/"),
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
total_area = 240000,
scale_unit = 1000,
wrangle_function = WrangleBoxplotMean,
plot_type_fun = PlotBoxplot
)
#Boxplot-effort
PlotMSE(
fleet_group_name = "ACT0018",
start_year = 25, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 6, plot_height_inches = 4,
y_value_label = "Effort", x_value_label = "Strategy",
units = "",
n_label_cols = 4,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "Effort/"),
fleet_lookup_file = fleet_lookup_table,
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
wrangle_function = WrangleBoxplotMean,
plot_type_fun = PlotBoxplot
)
#Timeseries-biomass
PlotMSE(
func_group_name = "AdCod",
true_year_beginning = 1990,
plot_width_inches = 12, plot_height_inches = 3,
y_value_label = "Biomass", x_value_label = "Years",
units = "kt",
n_label_cols = 4,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "Biomass/"),
save_plot_folder = plots_folder,
total_area = 240000,
scale_unit = 1000,
plot_type_fun = PlotTimeseries
)
#Timeseries-realisedF
PlotMSE(func_group_name = "AdCod",
start_year = 4, end_year = 29,
true_year_beginning = 1990,
plot_width_inches = 12, plot_height_inches = 3,
y_value_label = "Realised F", x_value_label = "Years",
units = "/km2/yr",
n_label_cols = 5,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "RealisedF/"),
save_plot_folder = plots_folder,
plot_type_fun = PlotTimeseries
)
#Timeseries-annual-change-TAC
PlotMSE(
func_group_name = "AdCod", fleet_group_name = "AllFleets",
true_year_beginning = 1990,
plot_width_inches = 12, plot_height_inches = 3,
y_value_label = "Annual Change in TAC", x_value_label = "Years",
units = "%",
n_label_cols = 5,
yearly_in_filename = FALSE,
results_folder_path = paste0(results_folder, "HCRQuota_Targ/"),
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
wrangle_function = WrangleTimeseriesAnnualChange,
plot_type_fun = PlotTimeseries
)
#Timeseries-catch
PlotMSE(
func_group_name = "AdCod", fleet_group_name = "ACT0018",
true_year_beginning = 1990,
plot_width_inches = 12, plot_height_inches = 3,
y_value_label = "Catch", x_value_label = "Years",
units = "kt/yr",
n_label_cols = 5,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "CatchTrajectories/"),
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
total_area = 240000,
scale_unit = 1000,
plot_type_fun = PlotTimeseries
)
#Timeseries-effort
PlotMSE(
fleet_group_name = "ACT0018",
start_year = NULL, end_year = 29,
true_year_beginning = 2004,
plot_width_inches = 12, plot_height_inches = 3,
y_value_label = "Effort", x_value_label = "Years",
n_label_cols = 4,
yearly_in_filename = TRUE,
results_folder_path = paste0(results_folder, "Effort/"),
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
plot_type_fun = PlotTimeseries
)
#Timeseries-TAC
PlotMSE(
func_group_name = "AdCod", fleet_group_name = "ACT1824",
true_year_beginning = 1990,
plot_width_inches = 12, plot_height_inches = 3,
y_value_label = "TAC", x_value_label = "Years",
units = "kt",
n_label_cols = 5,
yearly_in_filename = FALSE,
results_folder_path = paste0(results_folder, "HCRQuota_Targ/"),
save_plot_folder = plots_folder,
fleet_lookup_file = fleet_lookup_table,
total_area = 240000,
scale_unit = 1000,
plot_type_fun = PlotTimeseries
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.