Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(plot_spawning_biomass): Remove complications
Just have a standard plot and not all the if else statements by using simple ifelse statements in the code. Also, removed plots for non-standard output per Sam's guidance. * There was a problem with `if(any(grepl("target", output$label)))` because it ignored what the user specified in `ref_line` if target is present in label, i.e., you could never get to MSY. There should be a two-level check, i.e., what does the user want and is it present. I have not fixed this latter problem. * Fixed use of `..., ]$estimate` to `..., "estimate"]` because you should not use the dollar sign which allows for partial matches. * Use `switch()` statements instead of nested `if` `else` statements. Actually, now the function is so simple that I do not even have any switch statements but they can be helpful instead of nested if else statements. * Fixed the non-relative plots to truncate data to only use years less than end_yr * Some of the scaled items were hard-coded to 1000 instead of using scale_amount * Removed show_warnings because it was not actually doing anything * Use end_year rather than renaming it to endyr * Subset sb to end year before determining the correct number of breaks * MSY does not work so I removed it from the default reference list, only target and unfished work * Need to fix: * units are not divided by scale amount to create new unit label * Why do we think that our determination of breaks is better than what ggplot2 provides? * There is no example
- Loading branch information