Skip to contents

The MPs function is used both to create and modify an MPs-class() object. and to access and assign MPs for an object of class Slick-class(). See Details.

Usage

MPs(Code = "", Label = "", Description = "", Color = "", Preset = list())

MPs(object) <- value

# S4 method for class 'missing'
MPs()

# S4 method for class 'character_list'
MPs(Code = "", Label = "", Description = "", Color = "", Preset = list())

# S4 method for class 'Slick'
MPs(Code)

# S4 method for class 'Slick'
MPs(object) <- value

Arguments

Code

A short code for the Management Procedures in this Slick object. A character string length nMP or a named list for multi-language support. See Details

Label

A short label for the Management Procedures in this Slick object. Can be longer than Code but recommended to keep short as possible so it shows clearly in plots and tables. A character string length nMP or a named list for multi-language support. See Details

Description

A description for the Management Procedures in this Slick object. Can include Markdown, see Examples. A character string length nMP or a named list for multi-language support. See Details

Color

A character vector of colors for the MPs.

Preset

An optional named list for the preset buttons in the App(). The name of the list element will appear as a button in the App().

Use Code(), Label(), Description(), and Preset() to access and assign the values for an existing MPs object, see Examples.

object

A Slick-class() object

value

A MPs-class() object

Details

Objects of class MPs are created with MPs()

Functions

  • MPs(missing): Create an empty MPs object

  • MPs(character_list): Create a populated MPs object

  • MPs(Slick): Return an MPs-class() object from a Slick() object

  • MPs(Slick) <- value: Assign an MPs-class() object to a Slick() object

Examples


myMPs <- MPs()
Code(myMPs) <- c('MP1', 'MP2', 'MP3')
Label(myMPs) <- c('Management Procedure 1',
                  'Management Procedure 2',
                  'Management Procedure 3')
Description(myMPs) <- c('This is the description for Management Procedure 1',
                        'This is the description for Management Procedure 2',
                        'This is the description for Management Procedure 3')

Preset(myMPs) <- list(All=1:3, FirstTwo=1:2)


myMPs
#> 
#> ── An object of class `MPs` ────────────────────────────────────────────────────
#> 
#> ── `Code` ──
#> 
#> 1 MP1
#> 2 MP2
#> 3 MP3
#> 
#> ── `Label` ──
#> 
#> 1 Management Procedure 1
#> 2 Management Procedure 2
#> 3 Management Procedure 3
#> 
#> ── `Description` ──
#> 
#> 1 This is the description for Management P ...
#> 2 This is the description for Management P ...
#> 3 This is the description for Management P ...
#> 
#> ── `Color` ──
#> 
#> 1 #C87A8A
#> 2 #6B9D59
#> 3 #5F96C2
#> 
#> ── `Preset` ──
#> 
#> ── All 
#> 1
#> 2
#> 3
#> 
#> ── FirstTwo 
#> 1
#> 2

# Multi-language
Description(myMPs) <- list(en=c('This is the English description for Management Procedure 1',
                             'This is the English description for Management Procedure 2',
                             'This is the English description for Management Procedure 3'),
                           es=c("This is the Spanish description for Management Procedure 1",
                             "This is the Spanish description for Management Procedure 2",
                             "This is the Spanish description for Management Procedure 3"),
                           fr=c("This is the French description for Management Procedure 1",
                             "This is the French description for Management Procedure 2",
                             "This is the French description for Management Procedure 3"),
                           pt=c("This is the Portuguese description for Management Procedure 1",
                                "This is the Portuguese description for Management Procedure 2",
                                "This is the Portuguese description for Management Procedure 3")
                           )

Metadata(myMPs)
#>   Code                  Label
#> 1  MP1 Management Procedure 1
#> 2  MP2 Management Procedure 2
#> 3  MP3 Management Procedure 3
#>                                                  Description   Color
#> 1 This is the English description for Management Procedure 1 #C87A8A
#> 2 This is the English description for Management Procedure 2 #6B9D59
#> 3 This is the English description for Management Procedure 3 #5F96C2
Metadata(myMPs, 'es')
#>   Code                  Label
#> 1  MP1 Management Procedure 1
#> 2  MP2 Management Procedure 2
#> 3  MP3 Management Procedure 3
#>                                                  Description   Color
#> 1 This is the Spanish description for Management Procedure 1 #C87A8A
#> 2 This is the Spanish description for Management Procedure 2 #6B9D59
#> 3 This is the Spanish description for Management Procedure 3 #5F96C2
Metadata(myMPs, 'fr')
#>   Code                  Label
#> 1  MP1 Management Procedure 1
#> 2  MP2 Management Procedure 2
#> 3  MP3 Management Procedure 3
#>                                                 Description   Color
#> 1 This is the French description for Management Procedure 1 #C87A8A
#> 2 This is the French description for Management Procedure 2 #6B9D59
#> 3 This is the French description for Management Procedure 3 #5F96C2
Metadata(myMPs, 'pt')
#>   Code                  Label
#> 1  MP1 Management Procedure 1
#> 2  MP2 Management Procedure 2
#> 3  MP3 Management Procedure 3
#>                                                     Description   Color
#> 1 This is the Portuguese description for Management Procedure 1 #C87A8A
#> 2 This is the Portuguese description for Management Procedure 2 #6B9D59
#> 3 This is the Portuguese description for Management Procedure 3 #5F96C2

# Example `Slick` object included with the package (see `?WSKJ`)
Metadata(MPs(WSKJ))
#>   Code                                  Label
#> 1   CE                  Constant Exploitation
#> 2   IR                            Index Ratio
#> 3   SP     Surplus Production with linear HCR
#> 4 SPAH Surplus Production with non-linear HCR
#>                                                                                                                                                                               Description
#> 1 The TAC is adjusted based on the ratio of the estimated current exploitation rate to the mean exploitation rate from 2016 - 2017, with the aim to maintain a constant exploitation rate
#> 2                                                   The TAC is adjusted based on the ratio of the mean index over the 3 most recent years to the value of the mean index from 2019 - 2021
#> 3                                                                 A model-based a surplus production model with a 130-60 hockey stick harvest control rule and an F_Target equal to F_MSY
#> 4                                                                                                     The same surplus production model as SP, but with a non-linear harvest control rule
#>     Color
#> 1 #C87A8A
#> 2 #909646
#> 3 #00A396
#> 4 #9189C7