Title: | Easily Install and Load the 'openMSE' Packages |
---|---|
Description: | The 'openMSE' package is designed for building operating models, doing simulation modelling and management strategy evaluation for fisheries. 'openMSE' is an umbrella package for the 'MSEtool' (Management Strategy Evaluation toolkit), 'DLMtool' (Data-Limited Methods toolkit), and SAMtool (Stock Assessment Methods toolkit) packages. By loading and installing 'openMSE', users have access to the full functionality contained within these packages. Learn more about 'openMSE' at <https://openmse.com/>. |
Authors: | Adrian Hordyk [aut, cre] , Quang Huynh [aut], Tom Carruthers [aut] |
Maintainer: | Adrian Hordyk <[email protected]> |
License: | GPL-3 |
Version: | 1.0.1 |
Built: | 2024-12-23 05:46:17 UTC |
Source: | https://github.com/Blue-Matter/openMSE |
At-Age Time Series Variables
At_Age_TS_Variables
At_Age_TS_Variables
An object of class data.frame
with 6 rows and 3 columns.
Run an example MSE using three data-limited management procedures from
DLMtool
and one stock assessment model from SAMtool
.
demo()
demo()
The MSE is run and three example performance metrics plots are produced: a trade-off plot, a projection plot, and a Kobe plot.
An MSE about is invisibly returned, and can be explored further (e.g., summary(MSE)
).
Invisibly returns an MSE object, and produces example plots of performance metrics.
MSE <- demo()
MSE <- demo()
SAMtool
assessment method
used in an MSECreate a data.frame with estimated values from a SAMtool
assessment method
used in an MSE
get_Assess_Estimates(x, model = "Model 1") ## S3 method for class 'MSE' get_Assess_Estimates(x, model = "Model 1") ## S3 method for class 'list' get_Assess_Estimates(x, model = NULL) ## S3 method for class 'MMSE' get_Assess_Estimates(x, model = NULL)
get_Assess_Estimates(x, model = "Model 1") ## S3 method for class 'MSE' get_Assess_Estimates(x, model = "Model 1") ## S3 method for class 'list' get_Assess_Estimates(x, model = NULL) ## S3 method for class 'MMSE' get_Assess_Estimates(x, model = NULL)
x |
An object of class |
model |
An optional name for the model.
If |
A data.frame with columns:
Year_assess |
The year the assessment was run in the MSE |
Year_est |
The year corresponding with the estimated value |
Variable |
The estimated variable |
Value |
The estimated value |
MP |
The name of the management procedure |
Simulation |
The simulation number |
Model |
The name of model |
Note that the Selectivity and Retention curves in these plots are from the operating model. If an MP changes the selectivity/retention, this is not shown in these plots.
get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'Hist' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'list' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'MSE' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'multiHist' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'MMSE' get_at_Age(x, model = "Model 1", ...)
get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'Hist' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'list' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'MSE' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'multiHist' get_at_Age(x, model = "Model 1", ...) ## S3 method for class 'MMSE' get_at_Age(x, model = "Model 1", ...)
x |
An object of class |
model |
An optional name for the model.
If |
... |
additional arguments |
A data.frame
Create a data.frame with time-series information by simulation and year
get_at_age_ts( x, variable = "Spawning Biomass", model = "Model 1", scale = NULL )
get_at_age_ts( x, variable = "Spawning Biomass", model = "Model 1", scale = NULL )
x |
An object of class |
variable |
A character string with a valid name for a time-series variable.
Use |
model |
An optional name for the model.
If |
scale |
An optional function with a single numeric argument that returns transformed or scaled numeric values. See |
Note that the Selectivity and Retention curves in these plots are from the operating model. If an MP changes the selectivity/retention, this is not shown in these plots.
get_at_Length(x, model = "Model 1", ...) ## S3 method for class 'multiHist' get_at_Length(x, model = "Model 1", ...)
get_at_Length(x, model = "Model 1", ...) ## S3 method for class 'multiHist' get_at_Length(x, model = "Model 1", ...)
x |
An object of class |
model |
An optional name for the model.
If |
... |
additional arguments |
A data.frame
Extracts the life-history parameters: Linf
, K
, L50
, and ageM
get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'Hist' get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'list' get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'MSE' get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'MMSE' get_LifeHistory(x, model = "Model 1", ...)
get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'Hist' get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'list' get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'MSE' get_LifeHistory(x, model = "Model 1", ...) ## S3 method for class 'MMSE' get_LifeHistory(x, model = "Model 1", ...)
x |
An object of class |
model |
An optional name for the model.
If |
... |
additiona arguments (not used) |
A data.frame
Hist
or MSE
objectExtract the meta-data from a Hist
or MSE
object
get_Metadata(x) ## S3 method for class 'Hist' get_Metadata(x) ## S3 method for class 'MSE' get_Metadata(x) ## S3 method for class 'list' get_Metadata(x) ## S3 method for class 'MMSE' get_Metadata(x)
get_Metadata(x) ## S3 method for class 'Hist' get_Metadata(x) ## S3 method for class 'MSE' get_Metadata(x) ## S3 method for class 'list' get_Metadata(x) ## S3 method for class 'MMSE' get_Metadata(x)
x |
An object of class |
If x
is a list of objects, each object must
have identical structure, i.e., same number of simulations,
same number of age-classes, historical and projection years,
management procedures, etc
A named list with elements:
nsim |
The number of simulations |
nage |
The number of age classes |
Ages |
The age classes |
nyear |
The number of historical years |
Hist.Years |
A data.frame with the historical years in the Year column |
proyears |
The number of projection years |
Pro.Years |
A data.frame with the projection years in the Year column |
All.Years |
A data.frame with the historical and the projection years in the Year column |
nMPs |
The number of MPs (if x is an object of class MSE ) |
MPs |
The MPs (if x is an object of class MSE ) |
Create a data.frame with time-series information by simulation and year
get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) valid_ts_variables() valid_at_age_ts_variables() ## S3 method for class 'Hist' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'MSE' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'list' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'multiHist' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'MMSE' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) get_Biomass(x, model = "Model 1", ...) get_Landings(x, model = "Model 1", ...) get_Removals(x, model = "Model 1", ...) get_Recruits(x, model = "Model 1", ...) get_SSB(x, model = "Model 1", ...) get_SB_SBMSY(x, model = "Model 1", ...) get_F(x, model = "Model 1", ...) get_Biomass_at_Age(x, model = "Model 1", ...) get_Number_at_Age(x, model = "Model 1", ...) get_SSB_at_Age(x, model = "Model 1", ...)
get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) valid_ts_variables() valid_at_age_ts_variables() ## S3 method for class 'Hist' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'MSE' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'list' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'multiHist' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) ## S3 method for class 'MMSE' get_ts(x, variable = "Spawning Biomass", model = "Model 1", scale = NULL) get_Biomass(x, model = "Model 1", ...) get_Landings(x, model = "Model 1", ...) get_Removals(x, model = "Model 1", ...) get_Recruits(x, model = "Model 1", ...) get_SSB(x, model = "Model 1", ...) get_SB_SBMSY(x, model = "Model 1", ...) get_F(x, model = "Model 1", ...) get_Biomass_at_Age(x, model = "Model 1", ...) get_Number_at_Age(x, model = "Model 1", ...) get_SSB_at_Age(x, model = "Model 1", ...)
x |
An object of class |
variable |
A character string with a valid name for a time-series variable.
Use |
model |
An optional name for the model.
If |
scale |
An optional function with a single numeric argument that returns transformed or scaled numeric values. See |
... |
named arguments passed to |
Create a data.frame with Historical and Projection years
get_Years(x) ## S3 method for class 'MSE' get_Years(x) ## S3 method for class 'MMSE' get_Years(x) ## S3 method for class 'Hist' get_Years(x) ## S3 method for class 'multiHist' get_Years(x)
get_Years(x) ## S3 method for class 'MSE' get_Years(x) ## S3 method for class 'MMSE' get_Years(x) ## S3 method for class 'Hist' get_Years(x) ## S3 method for class 'multiHist' get_Years(x)
x |
An object of class |
A data.frame with years and period (Historical or Projection)
Convert numeric values to a different scale
lb2kg(x) lb2mt(x) kg2lb(x) kg2_1000lb(x) kg2mt(x) inch2mm(x) inch2cm(x) mm2inch(x) cm2inch(x) divide_1000(x) divide_100(x) divide_10(x) multiply_1000(x) multiply_100(x) multiply_10(x)
lb2kg(x) lb2mt(x) kg2lb(x) kg2_1000lb(x) kg2mt(x) inch2mm(x) inch2cm(x) mm2inch(x) cm2inch(x) divide_1000(x) divide_100(x) divide_10(x) multiply_1000(x) multiply_100(x) multiply_10(x)
x |
A vector of numeric values |
The vector of numeric values converted to the appropriate scale
lb2kg()
: Convert from pounds to kilograms
lb2mt()
: Convert from pounds to metric tons
kg2lb()
: Convert from kilograms to pounds
kg2_1000lb()
: Convert from kilograms to 1000 pounds
kg2mt()
: Convert from kilograms to metric tons
inch2mm()
: Convert from inches to millimeters
inch2cm()
: Convert from inches to centimeters
mm2inch()
: Convert from millimeters to inches
cm2inch()
: Convert from centimeters to inches
divide_1000()
: Divide values by 1000
divide_100()
: Divide values by 100
divide_10()
: Divide values by 10
multiply_1000()
: Multiply values by 1000
multiply_100()
: Multiply values by 100
multiply_10()
: Multiply values by 10
lb2kg(1:10) kg2lb(1:10)
lb2kg(1:10) kg2lb(1:10)
Plots Length, Weight, Maturity, Natural-Mortality, Selectivity, and Retention-at-Age schedules.
plot_at_Age( x, quantiles = c(0.025, 0.975), scale = NULL, variable = "Length", xlab = "Age (Year)", ylab = NULL, title = "", years = NULL, alpha = 0.1, lwd = 1, use_theme = NULL, colpalette = "Dark2", print = TRUE ) plot_Length(x, ...) plot_Weight(x, ...) plot_Maturity(x, ...) plot_N.Mortality(x, ...) plot_Select(x, ...) plot_Retention(x, ...) plot_Select_Maturity(x, ...)
plot_at_Age( x, quantiles = c(0.025, 0.975), scale = NULL, variable = "Length", xlab = "Age (Year)", ylab = NULL, title = "", years = NULL, alpha = 0.1, lwd = 1, use_theme = NULL, colpalette = "Dark2", print = TRUE ) plot_Length(x, ...) plot_Weight(x, ...) plot_Maturity(x, ...) plot_N.Mortality(x, ...) plot_Select(x, ...) plot_Retention(x, ...) plot_Select_Maturity(x, ...)
x |
An object of class |
quantiles |
Lower and upper quantiles to calculate. Numeric vector of length 2. |
scale |
An optional function with a single numeric argument that returns transformed or scaled numeric values. See |
variable |
String. One of 'Length', 'Weight', 'N.Mortality','Maturity', 'Select', 'Retention' |
xlab |
X-axis label (default 'Age (Year)') |
ylab |
Y-axes label |
title |
Optional title |
years |
Optional numeric vector specifying the years to plot. Default is the first and last historical year, and the last projection year |
alpha |
Transparency parameter |
lwd |
Line width |
use_theme |
Optional ggplot theme |
colpalette |
Color palette from |
print |
Logical. Print the plot? |
... |
Named arguments passed to |
Note that the Selectivity and Retention curves in these plots are from the operating model. If an MP changes the selectivity/retention, this is not shown in these plots.
A named list with:
p |
The ggplot object |
df |
Data.frame with the summary statistics (median and quantiles) |
plot_Length()
: Plot Length-at-Age
plot_Weight()
: Plot Weight-at-Age
plot_Maturity()
: Plot Maturity-at-Age
plot_N.Mortality()
: Plot N.Mortality-at-Age
plot_Select()
: Plot Selectivity-at-Age
plot_Retention()
: Plot Retention -at-Age
plot_Select_Maturity()
: Plot Selectivity-, Retention-, and Maturity-at-Age
Plots the median and quantiles of a time-series
plot_TS( x, xlab = "Year", ylab = "Spawning Biomass", title = "", quantiles = c(0.025, 0.975), scale = NULL, alpha = 0.1, lwd = 1, use_theme = NULL, colpalette = "Dark2", facet = TRUE, inc.Legend = !facet, inc.Hist = FALSE, print = TRUE, get_function = get_SSB, years = NULL, ... ) plot_SSB(x, ...) plot_Biomass(x, ylab = "Biomass", ...) plot_Landings(x, ylab = "Landings", ...) plot_Removals(x, ylab = "Removals", ...) plot_Recruits(x, ylab = "Recruits", ...) plot_F(x, ylab = "Fishing Mortality (F)", ...) plot_LifeHistory( x, xlab = "Year", ylab = "Median (quantiles)", title = "", quantiles = c(0.025, 0.975), scale = NULL, alpha = 0.1, lwd = 1, use_theme = NULL, colpalette = "Dark2", facet = TRUE, inc.Legend = !facet, inc.Hist = FALSE, print = TRUE )
plot_TS( x, xlab = "Year", ylab = "Spawning Biomass", title = "", quantiles = c(0.025, 0.975), scale = NULL, alpha = 0.1, lwd = 1, use_theme = NULL, colpalette = "Dark2", facet = TRUE, inc.Legend = !facet, inc.Hist = FALSE, print = TRUE, get_function = get_SSB, years = NULL, ... ) plot_SSB(x, ...) plot_Biomass(x, ylab = "Biomass", ...) plot_Landings(x, ylab = "Landings", ...) plot_Removals(x, ylab = "Removals", ...) plot_Recruits(x, ylab = "Recruits", ...) plot_F(x, ylab = "Fishing Mortality (F)", ...) plot_LifeHistory( x, xlab = "Year", ylab = "Median (quantiles)", title = "", quantiles = c(0.025, 0.975), scale = NULL, alpha = 0.1, lwd = 1, use_theme = NULL, colpalette = "Dark2", facet = TRUE, inc.Legend = !facet, inc.Hist = FALSE, print = TRUE )
x |
An object of class |
xlab |
X-axis label (default 'Year') |
ylab |
Y-axes label |
title |
Optional title |
quantiles |
Lower and upper quantiles to calculate. Numeric vector of length 2. |
scale |
An optional function with a single numeric argument that returns transformed or scaled numeric values. See |
alpha |
Transparency parameter |
lwd |
Line width |
use_theme |
Optional ggplot theme |
colpalette |
Color palette from |
facet |
Logical. Facet the plot? |
inc.Legend |
Logical. Include legend? |
inc.Hist |
Logical. For |
print |
Logical. Print the plot? |
get_function |
|
years |
Optional numeric vector specifying the years to plot. Default is all years. |
... |
Named arguments passed to |
A named list with:
p |
The ggplot object |
df |
Data.frame with the summary statistics (median and quantiles) |
plot_SSB()
: Plot the Spawning Biomass
plot_Biomass()
: Plot the Total Biomass
plot_Landings()
: Plot the Landings (biomass)
plot_Removals()
: Plot the Removals (biomass)
plot_Recruits()
: Plot the Recruits (numbers)
plot_F()
: Plot the Recruits (numbers)
plot_LifeHistory()
: Plot the Life-History parameters
A simple theme for ggplot2 that loosely resembles nicely themed plots from base graphics.
theme_default( base_size = 11, base_family = "", text_col = "grey20", panel_border_col = "grey70" )
theme_default( base_size = 11, base_family = "", text_col = "grey20", panel_border_col = "grey70" )
base_size |
Base font size. |
base_family |
Base font family. |
text_col |
Color for text. |
panel_border_col |
Color for panel borders. |
p <- ggplot2::ggplot(mtcars) + ggplot2::geom_point(ggplot2::aes(x = wt, y = mpg, colour = factor(gear))) + ggplot2::facet_wrap(~am) p + theme_default()
p <- ggplot2::ggplot(mtcars) + ggplot2::geom_point(ggplot2::aes(x = wt, y = mpg, colour = factor(gear))) + ggplot2::facet_wrap(~am) p + theme_default()
Time Series Variables
TS_Variables
TS_Variables
An object of class data.frame
with 21 rows and 3 columns.
Opens the openMSE Documentation website (requires internet connection)
userguide()
userguide()
Nothing is returned. Opens the 'openMSE.com' in the web browser
userguide()
userguide()