Type: | Package |
Title: | Interactive Visualization of MSE Results |
Version: | 1.0.0 |
Maintainer: | Adrian Hordyk <adrian@bluematterscience.com> |
Description: | A framework for visualizing and exploring results of a Management Strategy Evaluation (MSE). The publication quality figures and tables can be developed directly from the R console, or interactively explored with the 'Slick' App. For more details, see the 'Slick' website https://slick.bluematterscience.com. |
URL: | https://slick.bluematterscience.com/, https://github.com/Blue-Matter/Slick |
License: | GPL-2 |
Depends: | R (≥ 4.1.0) |
Imports: | cli, dplyr, DT, ggplot2, ggrepel, golem, graphics, grDevices, methods, scales, shiny, stats, tibble, utils |
Suggests: | bookdown, colourpicker, colorspace, cowplot, esquisse, flextable, fresh, httr, kableExtra, knitr, MSEtool, openMSE, RColorBrewer, shiny.i18n, shinyalert, shinyBS, shinycssloaders, shinydashboard, shinydashboardPlus, shinyhelper, shinyjs, shinyWidgets, rmarkdown, testthat (≥ 3.0.0), waiter |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.3 |
Collate: | 'RunSlick.R' 'Slick_tools.R' 'a_classunions.R' 'a_imports.R' 'aa_generics.R' 'app_config.R' 'app_server.R' 'app_ui.R' 'class_Boxplot.R' 'class_Check.R' 'class_Kobe.R' 'class_MPs.R' 'class_OMs.R' 'class_Quilt.R' 'class_Tradeoff.R' 'class_Timeseries.R' 'class_Spider.R' 'class_Slick.R' 'fct_FilterSlick.R' 'fct_Update.R' 'fct_check_required_packages.R' 'fct_check_slick.R' 'fct_colors.R' 'fct_dashboardHeader2.R' 'fct_load_casestudies.R' 'fct_misc.R' 'fct_plotBoxplot.R' 'fct_plotKobe.R' 'fct_plotQuilt.R' 'fct_plotSpider.R' 'fct_plotTimeseries.R' 'fct_plotTradeoff.R' 'fct_translator.R' 'make_Slick_old.R' 'man_functions.R' 'misc.R' 'mod_About.R' 'mod_Boxplot.R' 'mod_Boxplot_OM.R' 'mod_Boxplot_overall.R' 'mod_Global_Filters.R' 'mod_Home.R' 'mod_Kobe.R' 'mod_Kobe_overall.R' 'mod_Kobe_time.R' 'mod_MP_Color.R' 'mod_MP_Info.R' 'mod_Metadata.R' 'mod_OM_Info.R' 'mod_PM_Info.R' 'mod_Page_Filter.R' 'mod_Quilt.R' 'mod_Report_Add.R' 'mod_Report_Add_Button.R' 'mod_Report_Page.R' 'mod_Report_Page_plot.R' 'mod_Resources.R' 'mod_Sidebar.R' 'mod_Spider.R' 'mod_Spider_MP.R' 'mod_Spider_OM.R' 'mod_Spider_overall.R' 'mod_Timeseries.R' 'mod_Timeseries_byMP.R' 'mod_Timeseries_byOM.R' 'mod_Timeseries_overall.R' 'mod_Tradeoff.R' 'mod_filter_selection.R' 'mod_filter_selection_OM.R' 'mod_subtitle.R' 'mod_toplink.R' 'utils_Table.R' 'utils_util.R' |
BugReports: | https://github.com/Blue-Matter/Slick/issues |
NeedsCompilation: | no |
Packaged: | 2025-09-09 05:16:57 UTC; Adrian |
Author: | Adrian Hordyk [aut, cre], Tom Carruthers [aut], Quang Huynh [aut], Shana Miller [aut] |
Repository: | CRAN |
Date/Publication: | 2025-09-11 09:20:18 UTC |
Run the Slick App in the local browser
Description
An online hosted version of the Slick App is available here
Usage
App(...)
Arguments
... |
Additional arguments. To load a object directly in the App,
use |
Details
App()
runs the Slick Shiny Application
Value
None
Methods for Creating, Accessing and Assigning Boxplot
objects
Description
The Boxplot
function is used both to create and modify an Boxplot-class()
object.
and to access and assign Boxplot
for an object of class Slick-class()
.
See Details
.
Usage
Boxplot(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list(),
Defaults = list("overall", "boxplot")
)
Boxplot(Slick) <- value
## S4 method for signature 'missing'
Boxplot()
## S4 method for signature 'character_list'
Boxplot(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list(),
Defaults = list("overall", "boxplot")
)
## S4 method for signature 'Slick'
Boxplot(Code)
## S4 replacement method for signature 'Slick'
Boxplot(Slick) <- value
Arguments
Code |
A short code for the Performance Indicators for this object.
A character string length |
Label |
A short label for the Performance Indicators for this object. Used to label axes on charts.
Can be longer than |
Description |
A description for the Performance Indicators for this object.
Can include Markdown, see |
Value |
A numeric array with the stochastic performance indicator values for each
simulation (sim), operating model (OM), management procedure (MP), and performance indicator (PI).
Dimensions: c( |
Preset |
An optional named list for the preset buttons in the |
Defaults |
A list object with default selections for the Boxplot |
Slick |
A |
value |
A |
Details
Objects of class Boxplot
are created with Boxplot()
Use plotBoxplot()
to create the boxplot from the console.
Use the Code()
, Label()
, Description()
, Value()
, Preset()
functions to
access and assign the values for an existing Boxplot
object, see Examples
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in 'Value
Defaults
Defaults
is used to select the plot options that are selected in the Boxplot.
It is a list of length 2, with the following requirements for the list elements:
A character string. Options: 'overall' (default) or 'byom'
A character string. Options: 'boxplot' (default), 'violin', or 'both'
If unrecognized values are entered, the defaults will be used.
Functions
-
Boxplot(missing)
: Create an emptyBoxplot
object -
Boxplot(character_list)
: Create a populatedBoxplot
object -
Boxplot(Slick)
: ReturnBoxplot
from aSlick-class()
object -
Boxplot(Slick) <- value
: Assign aBoxplot-class()
object to aSlick-class()
object
See Also
Code()
, Label()
, Description()
, Metadata()
, Value()
,
Preset()
, Defaults()
, plotBoxplot()
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 3
values <- array(NA, dim=c(nsim, nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[,om, mp, pi] <- rlnorm(nsim, log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
boxplot <- Boxplot(Code=c('PI1', 'PI2', 'PI3'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3'),
Value=values)
# Check
Check(boxplot)
# Add to `Slick` object
slick <- Slick()
Boxplot(slick) <- boxplot
# Plots
plotBoxplot(slick)
plotBoxplot(slick, type='violin')
plotBoxplot(slick, byOM=TRUE)
plotBoxplot(slick, 2, type='both', byOM=TRUE)
Boxplot
S4 Object Class
Description
Objects of class Boxplot
are used to store information for the Boxplot and Violin plots.
Like all S4 objects in Slick
, slots in this object can be accessed and
assigned using functions corresponding to slot name. See Boxplot()
and the
the See Also
section below.
Details
Objects of class Boxplot
are created with Boxplot()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Slots
Code
A short code for the Performance Indicators for this object. A character string length
nPI
or a named list for multi-language support. SeeDetails
Label
A short label for the Performance Indicators for this object. Used to label axes on charts. Can be longer than
Code
but recommended to keep short as possible so it shows clearly in plots and tables. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Description
A description for the Performance Indicators for this object. Can include Markdown, see
Examples
. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Value
A numeric array with the stochastic performance indicator values for each simulation (sim), operating model (OM), management procedure (MP), and performance indicator (PI). Dimensions: c(
nsim
,nOM
,nMP
, andnPI
).Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.Defaults
A list object with default selections for the Boxplot. See
Boxplot()
See Also
Boxplot()
, Code()
, Label()
, Description()
,
Metadata()
, Value()
, Preset()
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 3
values <- array(NA, dim=c(nsim, nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[,om, mp, pi] <- rlnorm(nsim, log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
boxplot <- Boxplot(Code=c('PI1', 'PI2', 'PI3'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3'),
Value=values)
# Check
Check(boxplot)
# Add to `Slick` object
slick <- Slick()
Boxplot(slick) <- boxplot
# Plots
plotBoxplot(slick)
plotBoxplot(slick, type='violin')
plotBoxplot(slick, byOM=TRUE)
plotBoxplot(slick, 2, type='both', byOM=TRUE)
Check an object for errors or issues
Description
Checks S4 objects to check for warnings and errors
Usage
Check(object, ...)
## S4 method for signature 'Boxplot'
Check(object, req_dims = c(NA, NA, NA, NA))
## S4 method for signature 'Kobe'
Check(object)
## S4 method for signature 'MPs'
Check(object)
## S4 method for signature 'OMs'
Check(object)
## S4 method for signature 'Quilt'
Check(object)
## S4 method for signature 'Tradeoff'
Check(object)
## S4 method for signature 'Timeseries'
Check(object)
## S4 method for signature 'Spider'
Check(object)
## S4 method for signature 'Slick'
Check(object)
Arguments
object |
An object of class: |
... |
Additional arguments |
req_dims |
Required dimensions for |
Value
Prints messages to the console
Methods (by class)
-
Check(Boxplot)
: CheckBoxplot-class()
objects for errors -
Check(Kobe)
: CheckKobe-class()
objects for errors -
Check(MPs)
: CheckMPs-class()
objects for errors -
Check(OMs)
: CheckOMs-class()
objects for errors -
Check(Quilt)
: CheckQuilt-class()
objects for errors -
Check(Tradeoff)
: CheckTradeoff-class()
objects for errors -
Check(Timeseries)
: CheckTimeseries-class()
objects for errors -
Check(Spider)
: CheckSpider-class()
objects for errors -
Check(Slick)
: CheckSlick-class()
objects for errors
Examples
slick <- Slick()
Check(slick)
Access or assign Code
, Label
, and Description
for a valid object class
Description
Access or assign Code
, Label
, and Description
for a valid object class
Usage
Code(object, lang = "en")
Code(object) <- value
Description(object, lang = "en")
Description(object) <- value
Label(object, lang = "en")
Label(object) <- value
## S4 method for signature 'Boxplot'
Code(object, lang = "en")
## S4 replacement method for signature 'Boxplot'
Code(object) <- value
## S4 method for signature 'Boxplot'
Description(object, lang = "en")
## S4 method for signature 'Boxplot'
Label(object, lang = "en")
## S4 replacement method for signature 'Boxplot'
Label(object) <- value
## S4 replacement method for signature 'Boxplot'
Description(object) <- value
## S4 method for signature 'Kobe'
Code(object, lang = "en")
## S4 replacement method for signature 'Kobe'
Code(object) <- value
## S4 method for signature 'Kobe'
Description(object, lang = "en")
## S4 replacement method for signature 'Kobe'
Description(object) <- value
## S4 method for signature 'Kobe'
Label(object, lang = "en")
## S4 replacement method for signature 'Kobe'
Label(object) <- value
## S4 method for signature 'MPs'
Code(object, lang = "en")
## S4 replacement method for signature 'MPs'
Code(object) <- value
## S4 method for signature 'MPs'
Label(object, lang = "en")
## S4 replacement method for signature 'MPs'
Label(object) <- value
## S4 method for signature 'MPs'
Description(object, lang = "en")
## S4 replacement method for signature 'MPs'
Description(object) <- value
## S4 method for signature 'Quilt'
Code(object, lang = "en")
## S4 replacement method for signature 'Quilt'
Code(object) <- value
## S4 method for signature 'Quilt'
Description(object, lang = "en")
## S4 replacement method for signature 'Quilt'
Description(object) <- value
## S4 method for signature 'Quilt'
Label(object, lang = "en")
## S4 replacement method for signature 'Quilt'
Label(object) <- value
## S4 method for signature 'Tradeoff'
Code(object, lang = "en")
## S4 replacement method for signature 'Tradeoff'
Code(object) <- value
## S4 method for signature 'Tradeoff'
Description(object, lang = "en")
## S4 replacement method for signature 'Tradeoff'
Description(object) <- value
## S4 method for signature 'Tradeoff'
Label(object, lang = "en")
## S4 replacement method for signature 'Tradeoff'
Label(object) <- value
## S4 method for signature 'Timeseries'
Code(object, lang = "en")
## S4 replacement method for signature 'Timeseries'
Code(object) <- value
## S4 method for signature 'Timeseries'
Description(object, lang = "en")
## S4 replacement method for signature 'Timeseries'
Description(object) <- value
## S4 method for signature 'Timeseries'
Label(object, lang = "en")
## S4 replacement method for signature 'Timeseries'
Label(object) <- value
## S4 method for signature 'Spider'
Code(object, lang = "en")
## S4 replacement method for signature 'Spider'
Code(object) <- value
## S4 method for signature 'Spider'
Description(object, lang = "en")
## S4 replacement method for signature 'Spider'
Description(object) <- value
## S4 method for signature 'Spider'
Label(object, lang = "en")
## S4 replacement method for signature 'Spider'
Label(object) <- value
Arguments
object |
An object of class |
lang |
Optional text string specifying the language (if available). Either 'en', 'es', or 'fr' for English, Spanish, or French respectively |
value |
A character vector or a named list for multi-language support |
Details
Code
, Label
, and Description
must all be equal length.
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Value
Returns character string or named list with the contents of the Code
,
Label
, or Description
slot of object
Methods (by class)
-
Code(Boxplot)
: ReturnCode
from aBoxplot-class()
object -
Code(Boxplot) <- value
: AssignCode
to aBoxplot-class()
object -
Description(Boxplot)
: ReturnDescription
from aBoxplot-class()
object -
Label(Boxplot)
: ReturnLabel
from aBoxplot-class()
object -
Label(Boxplot) <- value
: AssignLabel
to aBoxplot-class()
object -
Description(Boxplot) <- value
: AssignDescription
to aBoxplot-class()
object -
Code(Kobe)
: ReturnCode
from aKobe-class()
object -
Code(Kobe) <- value
: AssignCode
to aKobe-class()
object -
Description(Kobe)
: ReturnDescription
from aKobe-class()
object -
Description(Kobe) <- value
: AssignDescription
to aKobe-class()
object -
Label(Kobe)
: ReturnLabel
from aKobe-class()
object -
Label(Kobe) <- value
: AssignLabel
to aKobe-class()
object -
Code(MPs)
: ReturnCode
from aMPs-class()
object -
Code(MPs) <- value
: AssignCode
to aMPs-class()
object -
Label(MPs)
: ReturnLabel
from aMPs-class()
object -
Label(MPs) <- value
: AssignLabel
to aMPs-class()
object -
Description(MPs)
: ReturnDescription
from aMPs-class()
object -
Description(MPs) <- value
: AssignDescription
to aMPs-class()
object -
Code(Quilt)
: ReturnCode
from aQuilt-class()
object -
Code(Quilt) <- value
: AssignCode
to aQuilt-class()
object -
Description(Quilt)
: ReturnDescription
from aQuilt-class()
object -
Description(Quilt) <- value
: AssignDescription
to aQuilt-class()
object -
Label(Quilt)
: ReturnLabel
from aQuilt-class()
object -
Label(Quilt) <- value
: AssignLabel
to aQuilt-class()
object -
Code(Tradeoff)
: ReturnCode
from aTradeoff-class()
object -
Code(Tradeoff) <- value
: AssignCode
to aTradeoff-class()
object -
Description(Tradeoff)
: ReturnDescription
from aTradeoff-class()
object -
Description(Tradeoff) <- value
: AssignDescription
to aTradeoff-class()
object -
Label(Tradeoff)
: ReturnLabel
from aTradeoff-class()
object -
Label(Tradeoff) <- value
: AssignLabel
to aTradeoff-class()
object -
Code(Timeseries)
: ReturnCode
from aTimeseries-class()
object -
Code(Timeseries) <- value
: AssignCode
to aTimeseries-class()
object -
Description(Timeseries)
: ReturnDescription
from aTimeseries-class()
object -
Description(Timeseries) <- value
: AssignDescription
to aTimeseries-class()
object -
Label(Timeseries)
: ReturnLabel
from aTimeseries-class()
object -
Label(Timeseries) <- value
: AssignLabel
to aTimeseries-class()
object -
Code(Spider)
: ReturnCode
from aSpider-class()
object -
Code(Spider) <- value
: AssignCode
to aSpider-class()
object -
Description(Spider)
: ReturnDescription
from aSpider-class()
object -
Description(Spider) <- value
: AssignDescription
to aSpider-class()
object -
Label(Spider)
: ReturnLabel
from aSpider-class()
object -
Label(Spider) <- value
: AssignLabel
to aSpider-class()
object
See Also
Label()
, Description()
, MPs-class()
, Boxplot-class()
,
Kobe-class()
, Quilt-class()
, Spider-class()
,
Timeseries-class()
, Tradeoff-class()
Access or assign Color
for MPs
and Quilt
objects
Description
Access or assign Color
for MPs
and Quilt
objects
Usage
Color(object)
Color(object) <- value
## S4 method for signature 'MPs'
Color(object)
## S4 replacement method for signature 'MPs'
Color(object) <- value
## S4 method for signature 'Quilt'
Color(object)
## S4 replacement method for signature 'Quilt'
Color(object) <- value
Arguments
object |
An |
value |
A character vector formatted to match the class of |
Value
Returns a character string with the contents of the Color
slot of
object
Methods (by class)
-
Color(MPs)
: ReturnColor
from aMPs-class()
object -
Color(MPs) <- value
: Preset AssignColor
to aMPs-class()
object -
Color(Quilt)
: ReturnColor
from aQuilt-class()
object -
Color(Quilt) <- value
: Preset AssignColor
to aQuilt-class()
object
Access or assign the default selections for the plots in the App()
Description
Access or assign the default selections for the plots in the App()
Usage
Defaults(object)
Defaults(object) <- value
## S4 method for signature 'Boxplot'
Defaults(object)
## S4 replacement method for signature 'Boxplot'
Defaults(object) <- value
## S4 method for signature 'Kobe'
Defaults(object)
## S4 replacement method for signature 'Kobe'
Defaults(object) <- value
Arguments
object |
|
value |
A list of default selections for the |
Value
Returns a list object with default selections from the Defaults
slot of
Boxplot()
and Kobe()
objects.
Methods (by class)
-
Defaults(Boxplot)
: DefaultsCode
from aBoxplot-class()
object -
Defaults(Boxplot) <- value
: AssignDefaults
to aBoxplot-class()
object -
Defaults(Kobe)
: DefaultsCode
from aKobe-class()
object -
Defaults(Kobe) <- value
: AssignDefaults
to aKobe-class()
object
Return the Design matrix from an OMs
object
Description
Return the Design matrix from an OMs
object
Usage
Design(object)
Design(object) <- value
## S4 method for signature 'OMs'
Design(object)
## S4 replacement method for signature 'OMs'
Design(object) <- value
## S4 method for signature 'Slick'
Design(object)
## S4 replacement method for signature 'Slick'
Design(object) <- value
Arguments
object |
A |
value |
A |
Value
The Design matrix from an OMs
object in a Slick
object
Methods (by class)
-
Design(OMs)
: Return the operating modelDesign
matrix from aOMs-class()
object -
Design(OMs) <- value
: Assign the operating modelDesign
matrix to aOMs-class()
object -
Design(Slick)
: Access the operating modelDesign
matrix from aSlick-class()
object -
Design(Slick) <- value
: Assign the operating modelDesign
matrix to aSlick-class()
object
Return the Factors matrix from an OMs
object
Description
Return the Factors matrix from an OMs
object
Usage
Factors(object, lang = "en")
Factors(object) <- value
## S4 method for signature 'OMs'
Factors(object, lang = "en")
## S4 replacement method for signature 'OMs'
Factors(object) <- value
## S4 method for signature 'Slick'
Factors(object, lang = "en")
## S4 replacement method for signature 'Slick'
Factors(object) <- value
Arguments
object |
A |
lang |
Optional text string specifying the language (if available). Either 'en', 'es', or 'fr' for English, Spanish, or French respectively |
value |
A |
Value
The Design matrix from an OMs
object in a Slick
object
Methods (by class)
-
Factors(OMs)
: Return the operating modelFactors
table from aOMs-class()
object -
Factors(OMs) <- value
: Assign the operating modelFactors
table to aOMs-class()
object -
Factors(Slick)
: Access the operating modelFactors
table from aSlick-class()
object -
Factors(Slick) <- value
: Assign the operating modelFactors
table to aSlick-class()
object
FilterSlick
Description
Filter a Slick Object
Usage
FilterSlick(slick = NULL, MPs = NULL, OMs = NULL, PIs = NULL, plot = NULL)
Arguments
slick |
An object of class |
MPs |
Numeric values of the MPs to keep. Default NULL keeps all MPs. |
OMs |
Numeric values of the OMs to keep (rows of |
PIs |
Numeric values of the PIs in |
plot |
The plot to filter the PIs. One of: |
Details
Filter a Slick Object by management procedures (MPs), operating models (OMs), and performance indicators (PIs) for a given plot
Value
A filtered Slick Object
Examples
slick <- Slick() # a completed slick object
boxplot_OM_1 <- FilterSlick(slick, OMs=1, plot='boxplot')
Methods for Creating, Accessing and Assigning Kobe
objects
Description
The Kobe
function is used both to create and modify an Kobe-class()
object.
and to access and assign Kobe
for an object of class Slick-class()
.
See Details
.
Usage
Kobe(
Code = "",
Label = "",
Description = "",
Time = numeric(),
TimeLab = "Year",
Value = array(),
Preset = list(),
Target = 1,
Limit = NULL,
Defaults = list(),
TimeTerminal = numeric()
)
Kobe(Slick) <- value
## S4 method for signature 'missing'
Kobe()
## S4 method for signature 'character'
Kobe(
Code = "",
Label = "",
Description = "",
Time = numeric(),
TimeLab = "Year",
Value = array(),
Preset = list(),
Target = 1,
Limit = NULL,
Defaults = list(),
TimeTerminal = numeric()
)
## S4 method for signature 'list'
Kobe(
Code = "",
Label = "",
Description = "",
Time = numeric(),
TimeLab = "Year",
Value = array(),
Preset = list(),
Target = 1,
Limit = NULL,
Defaults = list(),
TimeTerminal = numeric()
)
## S4 method for signature 'Slick'
Kobe(Code)
## S4 replacement method for signature 'Slick'
Kobe(Slick) <- value
Arguments
Code |
A short code for the Performance Indicators for this object.
A character string length |
Label |
A short label for the Performance Indicators for this object. Used to label axes on charts.
Can be longer than |
Description |
A description for the Performance Indicators for this object.
Can include Markdown, see |
Time |
A numeric vector with values for the projection time-steps. Must
match length |
TimeLab |
Character string length 1. Name of the time step (e.g., 'Year'). Will be used as the label in the |
Value |
A numeric array with the stochastic performance indicator values for each
simulation (sim), operating model (OM), management procedure (MP), performance indicator (PI),
and projection time-steps (nTS).
Dimensions: c( |
Preset |
An optional named list for the preset buttons in the |
Target |
Numeric vector length |
Limit |
Numeric vector length |
Defaults |
A list object with default selections for the Kobe See |
TimeTerminal |
Optional. By default the |
Slick |
A |
value |
A |
Details
Objects of class Kobe
are created with Kobe()
The Kobe plot typically shows B/BMSY (or something similar) on the x-axis, and F/FMSY (or something similar) on the y-axis.
Performance Indicators
The first PI will be on the x-axis (usually B/BMSY or something similar) and the second on the y-axis (e.g., F/FMSY)
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Functions
-
Kobe(missing)
: Create an emptyKobe
object -
Kobe(character)
: Create a populatedKobe
object -
Kobe(list)
: Create a populatedKobe
object -
Kobe(Slick)
: ReturnKobe
from aSlick-class()
object -
Kobe(Slick) <- value
: Assign aKobe-class()
object to aSlick-class()
object
See Also
Code()
, Label()
, Description()
, Time()
, [TimeLab(), Value()
, Preset()
,
Target()
and Limit()
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 2
nTS <- 30
values <- array(NA, dim=c(nsim, nOM, nMP, nPI, nTS))
pi_means <- c(1,1)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[,om, mp, pi,] <- pi_means[pi] *
matrix(
cumprod(c(rlnorm(nTS*nsim, 0, 0.05))),
nrow=nsim)
}
}
}
# Create and populate Object
kobe <- Kobe(Code=c('B/BMSY', 'F/FMSY'),
Label=c('B/BMSY',
'F/FMSY'),
Description = c('This is the description for PI 1',
'This is the description for PI 2'),
Value=values
)
# Add values for projection time steps
Time(kobe) <- seq(2025, by=1, length.out=nTS)
# Check
Check(kobe)
# Add to `Slick` object
slick <- Slick()
Kobe(slick) <- kobe
# Plots
plotKobe(slick)
plotKobe(slick, Time=TRUE)
S4 class Kobe
Description
Slots can be accessed and assigned using functions corresponding to slot name.
See See Also
section below.
Details
Objects of class Kobe
are created with Kobe()
Performance Indicators
By default, the first PI will be on the x-axis (usually B/BMSY or something similar) and the second
on the y-axis (e.g., F/FMSY). The Slick App()
provides drop down menus for selecting other PIs.
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Slots
Code
A short code for the Performance Indicators for this object. A character string length
nPI
or a named list for multi-language support. SeeDetails
Label
A short label for the Performance Indicators for this object. Used to label axes on charts. Can be longer than
Code
but recommended to keep short as possible so it shows clearly in plots and tables. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Description
A description for the Performance Indicators for this object. Can include Markdown, see
Examples
. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Time
A numeric vector with values for the projection time-steps. Must match length
nTS
inValue
TimeLab
Character string length 1. Name of the time step (e.g., 'Year'). Will be used as the label in the
Kobe Time
plot. Use a named list for multiple languages.Value
A numeric array with the stochastic performance indicator values for each simulation (sim), operating model (OM), management procedure (MP), performance indicator (PI), and projection time-steps (nTS) Dimensions: c(
nsim
,nOM
,nMP
,nPI
,nTS
)Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.Target
Numeric vector length
nPI
with the target value for the PIs. Defines the color quadrants on the Kobe plot. Defaults to 1.Limit
Numeric vector length
nPI
with the limit value for the two PIs. Shows as red line on Kobe plot. NULL to ignore.Defaults
A list object with default selections for the Kobe See
Kobe()
TimeTerminal
Optional. By default the
Kobe
plot shows the terminal projection year.TimeTerminal
can be used to override this. Use a numeric value indicating the time (must match a value inTime
) to use for theKobe
plot
See Also
Kobe()
, Code()
, Label()
, Description()
,
Value()
, Preset()
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 2
nTS <- 30
values <- array(NA, dim=c(nsim, nOM, nMP, nPI, nTS))
pi_means <- c(1,1)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[,om, mp, pi,] <- pi_means[pi] *
matrix(
cumprod(c(rlnorm(nTS*nsim, 0, 0.05))),
nrow=nsim)
}
}
}
# Create and populate Object
kobe <- Kobe(Code=c('B/BMSY', 'F/FMSY'),
Label=c('B/BMSY',
'F/FMSY'),
Description = c('This is the description for PI 1',
'This is the description for PI 2'),
Value=values
)
# Add values for projection time steps
Time(kobe) <- seq(2025, by=1, length.out=nTS)
# Check
Check(kobe)
# Add to `Slick` object
slick <- Slick()
Kobe(slick) <- kobe
# Plots
plotKobe(slick)
plotKobe(slick, Time=TRUE)
Access or assign Target
and Limit
for object of class Kobe
or Timeseries
Description
Access or assign Target
and Limit
for object of class Kobe
or Timeseries
Usage
Limit(object)
Limit(object) <- value
Target(object)
Target(object) <- value
## S4 method for signature 'Kobe'
Limit(object)
## S4 replacement method for signature 'Kobe'
Limit(object) <- value
## S4 method for signature 'Kobe'
Target(object)
## S4 replacement method for signature 'Kobe'
Target(object) <- value
## S4 method for signature 'Timeseries'
Limit(object)
## S4 replacement method for signature 'Timeseries'
Limit(object) <- value
## S4 method for signature 'Timeseries'
Target(object)
## S4 replacement method for signature 'Timeseries'
Target(object) <- value
Arguments
object |
A |
value |
Value to assign to |
Value
Returns a numeric vector with the contents of the Target
or Limit
slots of Kobe()
and
Timeseries()
objects
Methods (by class)
-
Limit(Kobe)
: ReturnLimit
from aKobe-class()
object -
Limit(Kobe) <- value
: AssignLimit
to aKobe-class()
object -
Target(Kobe)
: ReturnTarget
from aKobe-class()
object -
Target(Kobe) <- value
: AssignTarget
to aKobe-class()
object -
Limit(Timeseries)
: ReturnLimit
from aTimeseries-class()
object -
Limit(Timeseries) <- value
: AssignLimit
to aTimeseries-class()
object -
Target(Timeseries)
: ReturnTarget
from aTimeseries-class()
object -
Target(Timeseries) <- value
: AssignTarget
to aTimeseries-class()
object
Functions
-
Target(object) <- value
: Assignvalue
toobject@Target
Methods for Creating, Accessing and Assigning MPs
objects
Description
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 signature 'missing'
MPs()
## S4 method for signature 'character_list'
MPs(Code = "", Label = "", Description = "", Color = "", Preset = list())
## S4 method for signature 'Slick'
MPs(Code)
## S4 replacement method for signature 'Slick'
MPs(object) <- value
Arguments
Code |
A short code for the Management Procedures in this |
Label |
A short label for the Management Procedures in this |
Description |
A description for the Management Procedures in this |
Color |
A character vector of colors for the MPs. |
Preset |
An optional named list for the preset buttons in the Use |
object |
A |
value |
A |
Details
Objects of class MPs
are created with MPs()
Functions
-
MPs(missing)
: Create an emptyMPs
object -
MPs(character_list)
: Create a populatedMPs
object -
MPs(Slick)
: Return anMPs-class()
object from aSlick()
object -
MPs(Slick) <- value
: Assign anMPs-class()
object to aSlick()
object
See Also
Code()
, Label()
, Description()
, Color()
, Metadata()
, Preset()
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
# 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")
)
Metadata(myMPs)
Metadata(myMPs, 'es')
Metadata(myMPs, 'fr')
MPs
S4 class and functions
Description
An object of class MPs
contains information about the management procedures (MPs)
in a Slick-class()
object. Like all S4 objects in Slick
, slots in this
object can be accessed and assigned using functions corresponding to slot name.
See MPs()
and the the See Also
section below.
Details
Objects of class MPs
are created with MPs()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of management procedures (nMPs
) in the plot objects Boxplot
,
Kobe
, Quilt
, Spider
, Timeseries
, and Tradeoff
.
Slots
Code
A short code for the Management Procedures in this
Slick
object. A character string lengthnMP
or a named list for multi-language support. SeeDetails
RequiredLabel
A short label for the Management Procedures in this
Slick
object. Can be longer thanCode
but recommended to keep short as possible so it shows clearly in plots and tables. A character string lengthnMP
or a named list for multi-language support. SeeDetails
RequiredDescription
A description for the Management Procedures in this
Slick
object. Can include Markdown, seeExamples
. A character string lengthnMP
or a named list for multi-language support. SeeDetails
Color
A character vector of colors for the MPs. Defaults will be used if not populated
Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.
See Also
Code()
, Label()
, Description()
, Preset()
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
# 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")
)
Metadata(myMPs)
Metadata(myMPs, 'es')
Metadata(myMPs, 'fr')
Make an example Slick object
Description
A function that creates an example Slick data object
Usage
Make_Slick(
name = "Unnamed Slick object",
OM = NULL,
MPs = c("DCAC", "AvC", "Fratio", "FMSYref", "FMSYref50", "matlenlim"),
MP_Desc = NULL,
PMs = c("AAVE", "AAVY", "LTY", "P10", "P50", "P100", "PNOF", "STY", "Yield"),
Design = as.data.frame(cbind(rbind(as.matrix(expand.grid(1:2, 1:3, 1:2)), matrix(1,
nrow = 5, ncol = 3)), c(rep(1, 12), 2:6))),
SN = list(Factor_Labels = c("Natural Mortality", "Resilience", "Stock Depletion",
"Robustness"), Labels = list(c("M=0.2", "M=0.3"), c("h=0.5", "h=0.7", "h=0.9"),
c("Dep=0.1", "Dep=0.3"), c("Ref_Case", "L50=0.5", "Vmaxlen=0.1", "Cobs=0.5",
"Perr=0.5", "AC=0.95")), Codes = list(c("M2", "M3"), c("h5", "h7", "h9"), c("D1",
"D3"), c("Ref_case", "mat_low", "dome", "h_Cerr", "h_Perr", "h_AC")), Description =
list(c("M=0.2", "M=0.3"), c("h=0.5", "h=0.7", "h=0.9"), c("Dep=0.1", "Dep=0.3"),
c("Reference Case",
"L50=0.5", "Vmaxlen=0.1", "Cobs=0.5", "Perr=0.5",
"AC=0.95"))),
mods = list(function(OM, lev) {
if (lev == 1) OM@M <- c(0.2, 0.2)
if (lev ==
2) OM@M <- c(0.3, 0.3)
OM
}, function(OM, lev) {
if (lev == 1) OM@h <-
c(0.5, 0.5)
if (lev == 2) OM@h = c(0.7, 0.7)
if (lev == 3) OM@h = c(0.9,
0.9)
OM
}, function(OM, lev) {
if (lev == 1) OM@D <- c(0.1, 0.1)
if
(lev == 2) OM@D <- c(0.3, 0.3)
OM
}, function(OM, lev) {
if (lev == 2)
OM@L50 <- c(0.5, 0.5)
if (lev == 3) OM@Vmaxlen = c(0.1, 0.1)
if (lev == 4)
OM@Cobs = c(0.5, 0.5)
if (lev == 5) OM@Perr = c(0.5, 0.5)
if (lev == 6)
OM@AC = c(0.9, 0.9)
OM
}),
nsim = 48,
MSElist = NULL,
fstYr = NULL,
returnMSEs = FALSE
)
Arguments
name |
Character string that is the object name (abbreviated for use in menus etc) |
OM |
An operating model object (class 'OM') |
MPs |
A vector of methods (character string) of class MP |
MP_Desc |
A vector method descriptions (character string) nMPs long |
PMs |
A vector of performance metrics of class PM |
Design |
A design matrix of OM runs |
SN |
A list of Labels, Codes and Descriptions of the factor levels. Each list item is a factor containing a vector of factor levels. |
mods |
A nested list of mods |
nsim |
Integer, the number of simulations |
MSElist |
An optional list of prerun MSEs |
fstYr |
An optional numeric value for first projection year. Otherwise current year is used |
returnMSEs |
Logical, rather than the Slick object should the list of MSEs be returned? |
Value
An object of class Slick
Author(s)
T. Carruthers
Return Code
, Label
, Description
and other information from an object
Description
Return Code
, Label
, Description
and other information from an object
Usage
Metadata(object, lang = "en")
Metadata(object) <- value
## S4 method for signature 'Boxplot'
Metadata(object, lang = "en")
## S4 replacement method for signature 'Boxplot'
Metadata(object) <- value
## S4 method for signature 'Kobe'
Metadata(object, lang = "en")
## S4 replacement method for signature 'Kobe'
Metadata(object) <- value
## S4 method for signature 'MPs'
Metadata(object, lang = "en")
## S4 replacement method for signature 'MPs'
Metadata(object) <- value
## S4 method for signature 'Quilt'
Metadata(object, lang = "en")
## S4 replacement method for signature 'Quilt'
Metadata(object) <- value
## S4 method for signature 'Tradeoff'
Metadata(object, lang = "en")
## S4 replacement method for signature 'Tradeoff'
Metadata(object) <- value
## S4 method for signature 'Timeseries'
Metadata(object, lang = "en")
## S4 replacement method for signature 'Timeseries'
Metadata(object) <- value
## S4 method for signature 'Spider'
Metadata(object, lang = "en")
## S4 replacement method for signature 'Spider'
Metadata(object) <- value
## S4 method for signature 'Slick'
Metadata(object, lang = "en")
Arguments
object |
A |
lang |
Optional text string specifying the language (if available). Either 'en', 'es', or 'fr' for English, Spanish, or French respectively |
value |
Replacement value for |
Value
A data.frame
A data.frame
Methods (by class)
-
Metadata(Boxplot)
: Return Metadata forBoxplot-class()
objects -
Metadata(Boxplot) <- value
: Assign Metadata forBoxplot-class()
objects -
Metadata(Kobe)
: Return Metadata forKobe-class()
objects -
Metadata(Kobe) <- value
: Assign Metadata forKobe-class()
objects -
Metadata(MPs)
: Return Metadata forMPs-class()
objects -
Metadata(MPs) <- value
: Assign Metadata forMPs-class()
objects -
Metadata(Quilt)
: Return Metadata forQuilt-class()
objects -
Metadata(Quilt) <- value
: Assign Metadata forQuilt-class()
objects -
Metadata(Tradeoff)
: Return Metadata forTradeoff-class()
objects -
Metadata(Tradeoff) <- value
: Assign Metadata forTradeoff-class()
objects -
Metadata(Timeseries)
: Return Metadata forTimeseries-class()
objects -
Metadata(Timeseries) <- value
: Assign Metadata forTimeseries-class()
objects -
Metadata(Spider)
: Return Metadata forSpider-class()
objects -
Metadata(Spider) <- value
: Assign Metadata forSpider-class()
objects -
Metadata(Slick)
: ReturnAuthor
,Email
, andInstitution
fromSlick()
objects
Assign and access MinValue
and MaxValue
for a Quilt
object
Description
Assign and access MinValue
and MaxValue
for a Quilt
object
Usage
MinValue(Quilt)
MinValue(Quilt) <- value
MaxValue(Quilt)
MaxValue(Quilt) <- value
Arguments
Quilt |
A |
value |
A numeric vector with minimum or maximum values for the Performance Indicators. |
Value
A numeric value
Functions
-
MinValue()
: ReturnMinValue
from aQuilt-class()
object -
MinValue(Quilt) <- value
: AssignMinValue
to aQuilt-class()
object -
MaxValue()
: ReturnMaxValue
from aQuilt-class()
object -
MaxValue(Quilt) <- value
: AssignMaxValue
to aQuilt-class()
object
See Also
Creates a blank Slick object
Description
Creates a blank Slick object
Usage
NewSlick(
name = "Unnamed Slick Object",
nPerf = list(nD = 5, nS = 6, nP = 7),
nMPs = 5,
nsim = 10,
nProjYr = 50,
nStateVar = 2,
nHistYr = 55,
Design = expand.grid(1:2, 1:2)
)
Arguments
name |
Character string that is the object name (shortened for use in menus etc.) |
nPerf |
An integer vector of the number of deterministic (nD), stochastic (nS) and projected (nP) performance metrics |
nMPs |
Integer, the number of management options (aka management procedures). |
nsim |
Integer, the number of simulations (stochastic replicates per state of nature) |
nProjYr |
Integer, the number of projected years |
nStateVar |
Integer, the number of state variables |
nHistYr |
Integer, the number of historical years for state variables |
Design |
A design matrix of factor levels |
Value
An object of class Slick
Author(s)
T. Carruthers
Methods for Creating, Accessing and Assigning OMs
objects
Description
The OMs
function is used both to create and modify an OMs-class()
object.
and to access and assign OMs
for an object of class Slick-class()
.
See Details
.
Usage
OMs(Factors = data.frame(), Design = data.frame(), Preset = list())
OMs(object) <- value
## S4 method for signature 'missing'
OMs()
## S4 method for signature 'dataframe_list'
OMs(Factors = data.frame(), Design = data.frame(), Preset = list())
## S4 method for signature 'Slick'
OMs(Factors)
## S4 replacement method for signature 'Slick'
OMs(object) <- value
Arguments
Factors |
A |
Design |
A |
Preset |
An optional named list for the preset buttons in the |
object |
A |
value |
A |
Details
Factors
Factors
can be accessed and assigned using Factors(myslick)
and
Factors(myslick) <- data.frame()
respectively.
The Factor
column should be character strings with the name of each factor,
while the Level
column is a numeric
or character
value with the level for the
corresponding factor.
The Description
column is a description for each row, i.e., a unique factor and level.
See Examples
.
Design
The Design
matrix is nOM
rows and nFactor
columns. The values in each column should
either be numeric
values indicating the levels for the corresponding factor,
or the actual level values (i.e., Factors$Level
) that correspond to each OM. See Examples
.
Preset
For OMs
objects, Preset
should be a named list, where each list element represents a
different preset button to be shown in the app by the name of the list element, and
each named list element should be a list of length nFactors
, with the list elements
for each Factor containing numeric values indicating the levels to include for that factor.
See Examples
Use Factors()
, Design()
, and Preset()
to access
and assign the values for an existing OMs
object, see Examples
.
Functions
-
OMs(missing)
: Create an emptyOMs
object -
OMs(dataframe_list)
: Create a populatedOMs
object -
OMs(Slick)
: Return anOMs-class()
object from aSlick()
object -
OMs(Slick) <- value
: Assign anOMs-class()
object to aSlick()
object
See Also
OMs-class()
, Factors()
, Design()
, Preset()
Examples
# Create Object
oms <- OMs()
# Specify Factors
Factors(oms) <- data.frame(Factor='M',
Level=c('Base', 'Low M', 'High M'),
Description=c('Base Case',
'Lower Natural Mortality',
'Higher Natural Mortality')
)
Factors(oms)
# OM Design
Design(oms) <- data.frame(M=c('Base', 'Low M', 'High M'))
# Add names for OMs
rownames(Design(oms)) <- c('Base Case', 'Less Productive', 'More Productive')
Design(oms)
# Preset
Preset(oms) <- list('Base Case'=list(1),
'Low M' = list(2),
'High M' = list(3),
'All'= list(1:3)
)
# Create Slick Object
myslick <- Slick()
# Add OMs to Slick Object
OMs(myslick) <- oms
OMs
S4 class and functions
Description
An object of class OMs
contains information about the operating models (MPs)
in the Slick()
object. Like all S4 objects in Slick
, slots in this
object can be accessed and assigned using functions corresponding to slot name.
See OMs()
and the the See Also
section below.
Details
Multi-Language Support
Use a named list to use multi-languages in Factors
Factors
Factors
can be accessed and assigned using Factors(myslick)
and
Factors(myslick) <- data.frame()
respectively.
The Factor
column should be character strings with the name of each factor,
while the Level
column is a numeric
or character
value with the level for the
corresponding factor.
The Description
column is a description for each row, i.e., a unique factor and level.
See Examples
.
Design
The Design
matrix is nOM
rows and nFactor
columns. The values in each column should
either be numeric
values indicating the levels for the corresponding factor,
or the actual level values (i.e., Factors$Level
) that correspond to each OM. See Examples
.
Preset
For OMs
objects, Preset
should be a named list, where each list element represents a
different preset button to be shown in the app by the name of the list element, and
each named list element should be a list of length nFactors
, with the list elements
for each Factor containing numeric values indicating the levels to include for that factor.
See Examples
Slots
Factors
A
data.frame
with column headingsFactor
,Level
, andDescription
. SeeDetails
Design
A
data.frame
withnFactor
columns (i.e.,length(unique(Factors$Factor))
), andnOM
rows. SeeDetails
Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.. SeeDetails
andExamples
See Also
OMs()
, Factors()
, Design()
, Preset()
Examples
# Create Object
oms <- OMs()
# Specify Factors
Factors(oms) <- data.frame(Factor='M',
Level=c('Base', 'Low M', 'High M'),
Description=c('Base Case',
'Lower Natural Mortality',
'Higher Natural Mortality')
)
Factors(oms)
# OM Design
Design(oms) <- data.frame(M=c('Base', 'Low M', 'High M'))
# Add names for OMs
rownames(Design(oms)) <- c('Base Case', 'Less Productive', 'More Productive')
Design(oms)
# Preset
Preset(oms) <- list('Base Case'=list(1),
'Low M' = list(2),
'High M' = list(3),
'All'= list(1:3)
)
# Create Slick Object
myslick <- Slick()
# Add OMs to Slick Object
OMs(myslick) <- oms
Normalize performance metric values in a Slick object
Description
A function that converts deterministic or stochastic performance metrics to the range 0-100 and optionally inverts these
Usage
PMnorm(obj, det = TRUE, inv = NULL)
Arguments
obj |
An object of class 'slick' |
det |
logical, should the normalization be applied to the deterministic performance metrics (or, if false the stochastic ones) |
inv |
A logical vector nPM long. If true, the PM will be inverted (100-value). |
Value
An object of class Slick
Author(s)
T. Carruthers
Assign or access Preset
for a valid object class
Description
Assign or access Preset
for a valid object class
Usage
Preset(object)
Preset(object) <- value
## S4 method for signature 'Boxplot'
Preset(object)
## S4 replacement method for signature 'Boxplot'
Preset(object) <- value
## S4 method for signature 'Kobe'
Preset(object)
## S4 replacement method for signature 'Kobe'
Preset(object) <- value
## S4 method for signature 'MPs'
Preset(object)
## S4 replacement method for signature 'MPs'
Preset(object) <- value
## S4 method for signature 'OMs'
Preset(object)
## S4 replacement method for signature 'OMs'
Preset(object) <- value
## S4 method for signature 'Quilt'
Preset(object)
## S4 replacement method for signature 'Quilt'
Preset(object) <- value
## S4 method for signature 'Tradeoff'
Preset(object)
## S4 replacement method for signature 'Tradeoff'
Preset(object) <- value
## S4 method for signature 'Timeseries'
Preset(object)
## S4 replacement method for signature 'Timeseries'
Preset(object) <- value
## S4 method for signature 'Spider'
Preset(object)
## S4 replacement method for signature 'Spider'
Preset(object) <- value
Arguments
object |
An object of class |
value |
A |
Value
Returns a list object from the Preset
slot in object
Methods (by class)
-
Preset(Boxplot)
: ReturnPreset
from aBoxplot-class()
object -
Preset(Boxplot) <- value
: AssignPreset
slot from aBoxplot-class()
object -
Preset(Kobe)
: ReturnPreset
from aKobe-class()
object -
Preset(Kobe) <- value
: AssignPreset
to aKobe-class()
object -
Preset(MPs)
: ReturnPreset
from aMPs-class()
object -
Preset(MPs) <- value
: AssignPreset
to aMPs-class()
object -
Preset(OMs)
: ReturnPreset
from aOMs-class()
object -
Preset(OMs) <- value
: AssignPreset
to anOMs-class()
object -
Preset(Quilt)
: ReturnPreset
from aQuilt-class()
object -
Preset(Quilt) <- value
: AssignPreset
to aQuilt-class()
object -
Preset(Tradeoff)
: ReturnPreset
from aTradeoff-class()
object -
Preset(Tradeoff) <- value
: AssignPreset
to aTradeoff-class()
object -
Preset(Timeseries)
: ReturnPreset
from aTimeseries-class()
object -
Preset(Timeseries) <- value
: AssignPreset
to aTimeseries-class()
object -
Preset(Spider)
: ReturnPreset
from aSpider-class()
object -
Preset(Spider) <- value
: AssignPreset
slot from aSpider-class()
object
Methods for Creating, Accessing and Assigning Quilt
objects
Description
The Quilt
function is used both to create and modify an Quilt-class()
object.
and to access and assign Quilt
for an object of class Slick-class()
.
See Details
.
Usage
Quilt(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list(),
Color = c("darkblue", "lightblue"),
MinValue = as.numeric(NA),
MaxValue = as.numeric(NA)
)
Quilt(Slick) <- value
## S4 method for signature 'missing'
Quilt()
## S4 method for signature 'character_list'
Quilt(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list(),
Color = c("darkblue", "lightblue"),
MinValue = as.numeric(NA),
MaxValue = as.numeric(NA)
)
## S4 method for signature 'Slick'
Quilt(Code)
## S4 replacement method for signature 'Slick'
Quilt(Slick) <- value
Arguments
Code |
A short code for the Performance Indicators for this object.
A character string length |
Label |
A short label for the Performance Indicators for this object. Used to label axes on charts.
Can be longer than |
Description |
A description for the Performance Indicators for this object.
Can include Markdown, see |
Value |
A numeric array with the stochastic performance indicator values for each
operating model (OM), management procedure (MP), and performance indicator (PI).
Dimensions: c( |
Preset |
An optional named list for the preset buttons in the |
Color |
A character vector length 2 of colors for the maximum and minimum values in the chart. |
MinValue |
Numeric vector length |
MaxValue |
Numeric vector length |
Slick |
A |
value |
A |
Details
Objects of class Quilt
are created with Quilt()
Use the Code()
, Label()
, Description()
, Value()
, Preset()
, Color()
,
MinValue()
, and MaxValue()
functions to access and assign the values for
an existing Quilt
object, see Examples
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Functions
-
Quilt(missing)
: Create an emptyQuilt
object -
Quilt(character_list)
: Create a populatedQuilt
object -
Quilt(Slick)
: ReturnQuilt
from aSlick-class()
object -
Quilt(Slick) <- value
: Assign aQuilt-class()
object to aSlick-class()
object
See Also
Code()
, Label()
, Description()
, Color()
, Metadata()
, Preset()
,
Color()
, MinValue()
, MaxValue()
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- rlnorm(1,log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
quilt <- Quilt(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(quilt)
# Add to `Slick` object
slick <- Slick()
Quilt(slick) <- quilt
# Plots
plotQuilt(slick)
S4 class Quilt
Description
Objects of class Quilt
are used to store information for the Quilt chart.
Like all S4 objects in Slick
, slots in this object can be accessed and
assigned using functions corresponding to slot name. See Quilt()
and the
the See Also
section below.
Details
Objects of class Quilt
are created with Quilt()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Slots
Code
A short code for the Performance Indicators for this object. A character string length
nPI
or a named list for multi-language support. SeeDetails
Label
A short label for the Performance Indicators for this object. Used to label axes on charts. Can be longer than
Code
but recommended to keep short as possible so it shows clearly in plots and tables. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Description
A description for the Performance Indicators for this object. Can include Markdown, see
Examples
. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Value
A numeric array with the stochastic performance indicator values for each operating model (OM), management procedure (MP), and performance indicator (PI). Dimensions: c(
nOM
,nMP
, andnPI
)Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.Color
A character vector length 2 of colors for the maximum and minimum values in the chart.
MinValue
Numeric vector length
nPI
with the minimum possible value for the respective PIs. Defaults to minimum PI value inValue
(averaged across OMs in some cases)MaxValue
Numeric vector length
nPI
with the maximum possible value (i.e., best performance) for the respective PIs. Defaults to maximum PI value inValue
(averaged across OMs in some cases).
See Also
Quilt()
, Code()
, Label()
, Description()
,
Value()
, Preset()
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- rlnorm(1,log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
quilt <- Quilt(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(quilt)
# Add to `Slick` object
slick <- Slick()
Quilt(slick) <- quilt
# Plots
plotQuilt(slick)
Assign or access RefPoints
for a valid object class
Description
Assign or access RefPoints
for a valid object class
Usage
RefPoints(object)
RefPoints(object) <- value
## S4 method for signature 'Timeseries'
RefPoints(object)
## S4 replacement method for signature 'Timeseries'
RefPoints(object) <- value
Arguments
object |
An object of class |
value |
A |
Value
Returns a list object with the contents of the RefPoints
slot
of Timeseries()
objects
Methods (by class)
-
RefPoints(Timeseries)
: ReturnRefPoints
from aTimeseries-class()
object -
RefPoints(Timeseries) <- value
: AssignRefPoints
to aTimeseries-class()
object
Create a Slick
class object
Description
The Slick
class is the main object class used in the Slick
package. It
contains sub-objects for the management procedures MPs()
, operating models OMs()
,
and the six chart types: Boxplot()
, Kobe()
, Quilt()
, Spider()
,
Timeseries()
, and Tradeoff()
, as well as metadata information for the Slick
object such as Title
, Author
, and Introduction
.
Usage
Slick(
Title = "",
Subtitle = "",
Date = Sys.Date(),
Author = "",
Email = "",
Institution = "",
Introduction = "",
MPs = NULL,
OMs = NULL,
Boxplot = NULL,
Kobe = NULL,
Quilt = NULL,
Spider = NULL,
Timeseries = NULL,
Tradeoff = NULL
)
Title(object, lang = "en", markdown = FALSE)
Title(object) <- value
Subtitle(object, lang = "en", markdown = FALSE)
Subtitle(object) <- value
Date(object)
Date(object) <- value
Author(object, markdown = FALSE)
Author(object) <- value
Email(object, markdown = FALSE)
Email(object) <- value
Institution(object, lang = "en", markdown = FALSE)
Institution(object) <- value
Introduction(object, lang = "en", markdown = FALSE)
Introduction(object) <- value
Arguments
Title |
Title for the |
Subtitle |
Subtitle for the |
Date |
Date the Slick object was created. Text in format 'YYYY-MM-DD' or class |
Author |
A character vector with Author(s) names. The length of the vector should equal the number of authors. |
Email |
A character vector with email addresses for the author(s). Must be same length as |
Institution |
A character vector with institution details for the author(s). Must be same length as |
Introduction |
Introduction text for the |
MPs |
An object of class |
OMs |
An object of class |
Boxplot |
An object of class |
Kobe |
An object of class |
Quilt |
An object of class |
Spider |
An object of class |
Timeseries |
An object of class |
Tradeoff |
An object of class |
object |
A |
lang |
Optional text string specifying the language (if available). Either 'en', 'es', or 'fr' for English, Spanish, or French respectively |
markdown |
Logical. Process markdown? |
value |
The value to assign to the object. See |
Details
Objects of class Slick
are created with Slick()
.
Like all S4 objects in Slick
, slots in this object can be accessed and
assigned using functions corresponding to slot name. See Usage
and Functions
section.
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
All functions with the exception of Date
support Markdown.
Value
A Slick
object
Functions
-
Slick()
: Create aSlick-class()
object -
Title()
: AccessTitle
, Multi-language support -
Title(object) <- value
: AssignTitle
, Multi-language support -
Subtitle()
: AccessSubtitle
, Multi-language support -
Subtitle(object) <- value
: AssignSubtitle
, Multi-language support -
Date()
: AccessDate
-
Date(object) <- value
: AssignDate
-
Author()
: AccessAuthor
-
Author(object) <- value
: AssignAuthor
-
Email()
: AccessEmail
-
Email(object) <- value
: AssignEmail
-
Institution()
: AccessInstitution
-
Institution(object) <- value
: AssignInstitution
-
Introduction()
: AccessIntroduction
-
Introduction(object) <- value
: AssignIntroduction
, can include Markdown. SeeExamples
Slots
Title
Title for the
Slick
object. A character string. For multiple languages, use a named list with names:en
,es
,fr
for the three supported languages.Subtitle
Subtitle for the
Slick
object. A character string or a named list with languages:en
,es
,fr
Date
Date the Slick object was created. Text in format 'YYYY-MM-DD' or class
Date
e.g.,Sys.Date()
Author
A character vector with Author(s) names. The length of the vector should equal the number of authors.
Email
A character vector with email addresses for the author(s). Must be same length as
Author
. Can include Markdown.Institution
A character vector with institution details for the author(s). Must be same length as
Author
. Can include Markdown.Introduction
Introduction text for the
Slick
object. Supports all markdown formatting. Character string, must be length 1. For multiple languages, use a named list with names:en
,es
,fr
for the three supported languages.MPs
An object of class
MPs-class()
OMs
An object of class
OMs-class()
Boxplot
An object of class
Boxplot-class()
Kobe
An object of class
Kobe-class()
Quilt
An object of class
Quilt-class()
Spider
An object of class
Spider-class()
Timeseries
An object of class
Timeseries-class()
Tradeoff
An object of class
Tradeoff-class()
See Also
MPs()
, OMs()
, Boxplot()
, Kobe()
, Quilt()
,
Spider()
, Timeseries()
, Tradeoff()
, Check()
,
Title()
, Subtitle()
, Date()
, Author()
, Email()
,
Institution()
, Introduction()
Examples
# Assign values to a new `Slick` object
slick <- Slick()
Title(slick) <- 'An Example Slick Object'
Subtitle(slick) <- ""
Date(slick) <- Sys.Date()
Author(slick) <- 'Adrian Hordyk'
Email(slick) <- "[mailto:adrian@bluematterscience.com](mailto:adrian@bluematterscience.com)"
Institution(slick) <- "[Blue Matter Science](bluematterscience.com)"
Introduction(slick) <- "This is the Introduction text"
# Access values from `Slick` object
Title(slick)
Subtitle(slick)
Date(slick)
Author(slick)
Email(slick)
Institution(slick)
Introduction(slick)
Methods for Creating, Accessing and Assigning Spider
objects
Description
The Spider
function is used both to create and modify an Spider-class()
object.
and to access and assign Spider
for an object of class Slick-class()
.
See Details
.
Usage
Spider(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list()
)
Spider(Slick) <- value
## S4 method for signature 'missing'
Spider()
## S4 method for signature 'character'
Spider(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list()
)
## S4 method for signature 'list'
Spider(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list()
)
## S4 method for signature 'Slick'
Spider(Code)
## S4 replacement method for signature 'Slick'
Spider(Slick) <- value
Arguments
Code |
A short code for the Performance Indicators for this object.
A character string length |
Label |
A short label for the Performance Indicators for this object. Used to label axes on charts.
Can be longer than |
Description |
A description for the Performance Indicators for this object.
Can include Markdown, see |
Value |
A numeric array with the stochastic performance indicator values for each
operating model (OM), management procedure (MP), and performance indicator (PI).
Dimensions: c( |
Preset |
An optional named list for the preset buttons in the |
Slick |
A |
value |
A |
Details
Objects of class Spider
are created with Spider()
Use the Code()
, Label()
, Description()
, Value()
, Preset()
functions to
access and assign the values for an existing Spider
object, see Examples
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in 'Value
Functions
-
Spider(missing)
: Create an emptySpider
object -
Spider(character)
: Create a populatedSpider
object -
Spider(list)
: Create a populatedSpider
object -
Spider(Slick)
: ReturnSpider
from aSlick-class()
object -
Spider(Slick) <- value
: Assign aSpider-class()
object to aSlick-class()
object
See Also
Code()
, Label()
, Description()
, Metadata()
, Value()
, Preset()
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
# Note: PI values must be between 0 and 1, with 1 indicating better performance
pi_means <- runif(nPI, 0, 1)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- runif(1, pi_means[pi])
}
}
}
# Create and populate Object
spider <- Spider(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(spider)
# Add to `Slick` object
slick <- Slick()
Spider(slick) <- spider
# Plots
plotSpider(slick)
plotSpider(slick, fill=TRUE)
plotSpider(slick, byMP=TRUE)
plotSpider(slick, byOM=TRUE)
S4 class Spider
Description
Objects of class Spider
are used to store information for the Spider plots.
Like all S4 objects in Slick
, slots in this object can be accessed and
assigned using functions corresponding to slot name. See Spider and the
the See Also
section below.
Details
Objects of class Spider
are created with Spider()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Slots
Code
A short code for the Performance Indicators for this object. A character string length
nPI
or a named list for multi-language support. SeeDetails
Label
A short label for the Performance Indicators for this object. Used to label axes on charts. Can be longer than
Code
but recommended to keep short as possible so it shows clearly in plots and tables. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Description
A description for the Performance Indicators for this object. Can include Markdown, see
Examples
. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Value
A numeric array with the stochastic performance indicator values for each operating model (OM), management procedure (MP), and performance indicator (PI). Dimensions: c(
nOM
,nMP
, andnPI
). All PI values must range between 0 and 1 or 0 and 100. If all values are <= 1, they will be multiplied by 100 in the plot. Dimensions: c(nOM
,nMP
, andnPI
)Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.
See Also
Spider, Code()
, Label()
, Description()
,
Value()
, Preset()
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
# Note: PI values must be between 0 and 1, with 1 indicating better performance
pi_means <- runif(nPI, 0, 1)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- runif(1, pi_means[pi])
}
}
}
# Create and populate Object
spider <- Spider(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(spider)
# Add to `Slick` object
slick <- Slick()
Spider(slick) <- spider
# Plots
plotSpider(slick)
plotSpider(slick, fill=TRUE)
plotSpider(slick, byMP=TRUE)
plotSpider(slick, byOM=TRUE)
Access or assign Time
for object of class Kobe
or Timeseries
Description
Access or assign Time
for object of class Kobe
or Timeseries
Usage
Time(object)
Time(object) <- value
## S4 method for signature 'Kobe'
Time(object)
## S4 replacement method for signature 'Kobe'
Time(object) <- value
## S4 method for signature 'Timeseries'
Time(object)
## S4 replacement method for signature 'Timeseries'
Time(object) <- value
Arguments
object |
A |
value |
Value to assign to |
Value
Returns a numeric vector with values from the Time
slot in
Kobe()
and Timeseries()
objects
Methods (by class)
-
Time(Kobe)
: ReturnTime
from aKobe-class()
object -
Time(Kobe) <- value
: AssignTime
to aKobe-class()
object -
Time(Timeseries)
: ReturnTime
from aTimeseries-class()
object -
Time(Timeseries) <- value
: AssignTime
to aTimeseries-class()
object
Functions
-
Time(object) <- value
: Assignvalue
toobject@Time
Access or assign TimeLab
in a Kobe
or Timeseries
object
Description
Access or assign TimeLab
in a Kobe
or Timeseries
object
Usage
TimeLab(object, lang = "en")
TimeLab(object) <- value
## S4 method for signature 'Kobe'
TimeLab(object, lang = "en")
## S4 replacement method for signature 'Kobe'
TimeLab(object) <- value
## S4 method for signature 'Timeseries'
TimeLab(object, lang = "en")
## S4 replacement method for signature 'Timeseries'
TimeLab(object) <- value
Arguments
object |
A |
lang |
Optional text string specifying the language (if available). Either 'en', 'es', or 'fr' for English, Spanish, or French respectively |
value |
A character string to assign to |
Value
Returns a character string from the TimeLab
slot in
Kobe()
and Timeseries()
objects
Methods (by class)
-
TimeLab(Kobe)
: ReturnTimeLab
from aKobe-class()
object -
TimeLab(Kobe) <- value
: AssignTimeLab
to aKobe-class()
object -
TimeLab(Timeseries)
: ReturnTimeLab
from aTimeseries-class()
object -
TimeLab(Timeseries) <- value
: AssignTimeLab
to aTimeseries-class()
object
Access and return TimeNow
from a Timeseries-class()
object
Description
Access and return TimeNow
from a Timeseries-class()
object
Usage
TimeNow(Timeseries)
TimeNow(Timeseries) <- value
Arguments
Timeseries |
A |
value |
A character string label for the time axis. Use a named list for multiple languages |
Value
A numeric value
Functions
-
TimeNow(Timeseries) <- value
: AssignTimeNow
to aTimeseries-class()
object
Assign or access TimeTerminal
for a valid object class
Description
Assign or access TimeTerminal
for a valid object class
Usage
TimeTerminal(object)
TimeTerminal(object) <- value
## S4 method for signature 'Kobe'
TimeTerminal(object)
## S4 replacement method for signature 'Kobe'
TimeTerminal(object) <- value
Arguments
object |
An object of class |
value |
A |
Value
Returns a numeric values from the TimeTerminal
slot in Kobe()
objects
Methods (by class)
-
TimeTerminal(Kobe)
: ReturnTimeTerminal
from aKobe-class()
object -
TimeTerminal(Kobe) <- value
: AssignTimeTerminal
to aKobe-class()
object
Methods for Creating, Accessing and Assigning Timeseries
objects
Description
An object of class Timeseries
contains information for the Time Series chart.
The Timeseries
function is used both to create and modify an Timeseries-class()
object,
and to access and assign Timeseries
for an object of class Slick-class()
.
See Details
.
Usage
Timeseries(
Code = "",
Label = "",
Description = "",
Time = numeric(),
TimeNow = numeric(),
TimeLab = "Year",
Value = array(),
Preset = list(),
Target = NULL,
Limit = NULL,
RefPoints = list()
)
Timeseries(Slick) <- value
## S4 method for signature 'missing'
Timeseries()
## S4 method for signature 'character'
Timeseries(
Code = "",
Label = "",
Description = "",
Time = numeric(),
TimeNow = numeric(),
TimeLab = "Year",
Value = array(),
Preset = list(),
Target = NULL,
Limit = NULL,
RefPoints = list()
)
## S4 method for signature 'list'
Timeseries(
Code = "",
Label = "",
Description = "",
Time = numeric(),
TimeNow = numeric(),
TimeLab = "Year",
Value = array(),
Preset = list(),
Target = NULL,
Limit = NULL,
RefPoints = list()
)
## S4 method for signature 'Slick'
Timeseries(Code)
## S4 replacement method for signature 'Slick'
Timeseries(Slick) <- value
Arguments
Code |
A short code for the Performance Indicators for this object.
A character string length |
Label |
A short label for the Performance Indicators for this object. Used to label axes on charts.
Can be longer than |
Description |
A description for the Performance Indicators for this object.
Can include Markdown, see |
Time |
A numeric vector with values for the historical and projection time-steps. Must
match length |
TimeNow |
A numeric value matching the last historical timestep in |
TimeLab |
Character string length 1. Name of the time step (e.g., 'Year').
Will be used as the label in the |
Value |
A numeric array with the stochastic performance indicator values for each
simulation (sim), operating model (OM), management procedure (MP), performance indicator (PI),
and historical + projection timestep (nTS).
Dimensions: c( |
Preset |
An optional named list for the preset buttons in the |
Target |
Numeric vector length |
Limit |
Numeric vector length |
RefPoints |
List for setting custom Reference Points. Overrides |
Slick |
A |
value |
A |
Details
Use plotTimeseries()
to create the boxplot from the console.
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Objects of class Timeseries
are created with Timeseries()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Custom Reference Points with RefPoints
RefPoints
provides more options than the default Target
and Limit
reference points. It can be used to control the name and
color of the reference point lines, or to add additional reference point lines to the Timeseries
plot.
Note: If RefPoints
is included, Target
and Limit
are ignored.
RefPoints
must be a list of length <= length(Code)
(i.e., the number of performance indicators).
Each element in RefPoints
should be a named list:
-
Name
character vector with name(s) of reference point(s) -
Value
numeric vector lengthName
with value(s) for the reference point(s) -
Color
character vector lengthName
with color(s) for the reference point(s)
See Examples
Accessing Slots
Use the Code()
, Label()
, Description()
, Value()
, Preset()
functions to access and assign the values for an
existing Timeseries
object, see Examples
Functions
-
Timeseries(missing)
: Create an emptyTimeseries
object -
Timeseries(character)
: Create a populatedTimeseries
object -
Timeseries(list)
: Create a populatedTimeseries
object -
Timeseries(Slick)
: ReturnTimeseries
from aSlick-class()
object -
Timeseries(Slick) <- value
: Assign aTimeseries-class()
object to aSlick-class()
object
See Also
Timeseries-class()
, Code()
, Label()
, Description()
,
Metadata()
, Value()
, Preset()
, plotTimeseries()
Code()
, Label()
, Description()
, Metadata()
, Value()
, Preset()
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 3
nHistTS <- 50
nProjTS <- 30
nTS <- nHistTS + nProjTS
set.seed(101)
values <- array(NA, dim=c(nsim, nOM, nMP, nPI, nTS))
pi_means <- c(1,1, 1000)
for (om in 1:nOM) {
for (pi in 1:nPI) {
# PI identical for historical
histVals <- matrix(
pi_means[pi] *
cumprod(c(rlnorm(nHistTS*nsim, 0, 0.05))),
nrow=nsim, ncol=nHistTS, byrow=TRUE)
histVals <- replicate(nMP, histVals)
values[,om, , pi,1:nHistTS] <- aperm(histVals, c(1,3,2))
for (mp in 1:nMP) {
values[,om, mp, pi,(nHistTS+1):nTS] <- matrix(
pi_means[pi] *
cumprod(c(rlnorm(nProjTS*nsim, 0, 0.05))),
nrow=nsim, ncol=nProjTS, byrow=FALSE)
}
}
}
# Create and populate Object
timeseries <- Timeseries(Code=c('B/BMSY', 'F/FMSY', 'TAC'),
Label=c('B/BMSY',
'F/FMSY',
'TAC'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3'),
Value=values
)
# Last historical time step
TimeNow(timeseries) <- 2024
# Add values for time steps
Time(timeseries) <- c(rev(seq(TimeNow(timeseries), by=-1, length.out=nHistTS)),
seq(TimeNow(timeseries)+1, by=1, length.out=nProjTS))
# Check
Check(timeseries)
# Add to `Slick` object
slick <- Slick()
Timeseries(slick) <- timeseries
# Plots
plotTimeseries(slick)
plotTimeseries(slick, 2)
plotTimeseries(slick, 3)
plotTimeseries(slick, byMP=TRUE)
plotTimeseries(slick, byOM=TRUE)
# Custom Reference Points
RefPoints(timeseries) <- list(
list(Name=c('0.5 BMSY', 'BMSY', '1.5 BMSY'),
Value=c(0.5, 1, 1.5),
Color=c('red', 'orange', 'green')),
list(Name=c('0.8 FMSY', 'FMSY'),
Value=c(0.8,1),
Color=c('orange', 'red')),
list(Name='Target Catch',
Value=1200,
Color='blue')
)
Timeseries(slick) <- timeseries
plotTimeseries(slick)
plotTimeseries(slick, 2)
plotTimeseries(slick, 3)
S4 class Timeseries
Description
Objects of class Timeseries
are used to store information for the Time Series plots.
Like all S4 objects in Slick
, slots in this object can be accessed and
assigned using functions corresponding to slot name. See Timeseries()
and the
the See Also
section below.
Details
Objects of class Timeseries
are created with Timeseries()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Slots
Code
A short code for the Performance Indicators for this object. A character string length
nPI
or a named list for multi-language support. SeeDetails
Label
A short label for the Performance Indicators for this object. Used to label axes on charts. Can be longer than
Code
but recommended to keep short as possible so it shows clearly in plots and tables. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Description
A description for the Performance Indicators for this object. Can include Markdown, see
Examples
. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Time
A numeric vector with values for the historical and projection time-steps. Must match length
nTS
inValue
. Can also be classDate
,POSIXct
orPOSIXt
TimeNow
A numeric value matching the last historical timestep in
Time
TimeLab
Character string length 1. Name of the time step (e.g., 'Year'). Will be used as the label in the plots. Use a named list for multiple languages.
Value
A numeric array with the stochastic performance indicator values for each simulation (sim), operating model (OM), management procedure (MP), performance indicator (PI), and historical + projection timestep (nTS). Dimensions: c(
nsim
,nOM
,nMP
,nPI
,nTS
)Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.Target
Numeric vector length
nPI
with the target value for the PIs.Limit
Numeric vector length
nPI
with the limit value for the PIs.RefPoints
List for setting custom Reference Points. Overrides
Target
andLimit
. SeeDetails
section inTimeseries()
.
See Also
Timeseries()
, Code()
, Label()
, Description()
,
Value()
, Preset()
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 3
nHistTS <- 50
nProjTS <- 30
nTS <- nHistTS + nProjTS
set.seed(101)
values <- array(NA, dim=c(nsim, nOM, nMP, nPI, nTS))
pi_means <- c(1,1, 1000)
for (om in 1:nOM) {
for (pi in 1:nPI) {
# PI identical for historical
histVals <- matrix(
pi_means[pi] *
cumprod(c(rlnorm(nHistTS*nsim, 0, 0.05))),
nrow=nsim, ncol=nHistTS, byrow=TRUE)
histVals <- replicate(nMP, histVals)
values[,om, , pi,1:nHistTS] <- aperm(histVals, c(1,3,2))
for (mp in 1:nMP) {
values[,om, mp, pi,(nHistTS+1):nTS] <- matrix(
pi_means[pi] *
cumprod(c(rlnorm(nProjTS*nsim, 0, 0.05))),
nrow=nsim, ncol=nProjTS, byrow=FALSE)
}
}
}
# Create and populate Object
timeseries <- Timeseries(Code=c('B/BMSY', 'F/FMSY', 'TAC'),
Label=c('B/BMSY',
'F/FMSY',
'TAC'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3'),
Value=values
)
# Last historical time step
TimeNow(timeseries) <- 2024
# Add values for time steps
Time(timeseries) <- c(rev(seq(TimeNow(timeseries), by=-1, length.out=nHistTS)),
seq(TimeNow(timeseries)+1, by=1, length.out=nProjTS))
# Check
Check(timeseries)
# Add to `Slick` object
slick <- Slick()
Timeseries(slick) <- timeseries
# Plots
plotTimeseries(slick)
plotTimeseries(slick, 2)
plotTimeseries(slick, 3)
plotTimeseries(slick, byMP=TRUE)
plotTimeseries(slick, byOM=TRUE)
# Custom Reference Points
RefPoints(timeseries) <- list(
list(Name=c('0.5 BMSY', 'BMSY', '1.5 BMSY'),
Value=c(0.5, 1, 1.5),
Color=c('red', 'orange', 'green')),
list(Name=c('0.8 FMSY', 'FMSY'),
Value=c(0.8,1),
Color=c('orange', 'red')),
list(Name='Target Catch',
Value=1200,
Color='blue')
)
Timeseries(slick) <- timeseries
plotTimeseries(slick)
plotTimeseries(slick, 2)
plotTimeseries(slick, 3)
Methods for Creating, Accessing and Assigning Tradeoff
objects
Description
The Tradeoff
function is used both to create and modify an Tradeoff-class()
object.
and to access and assign Tradeoff
for an object of class Slick-class()
.
See Details
.
Usage
Tradeoff(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list()
)
Tradeoff(Slick) <- value
## S4 method for signature 'missing'
Tradeoff()
## S4 method for signature 'character'
Tradeoff(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list()
)
## S4 method for signature 'list'
Tradeoff(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list()
)
## S4 method for signature 'Slick'
Tradeoff(Code)
## S4 replacement method for signature 'Slick'
Tradeoff(Slick) <- value
Arguments
Code |
A short code for the Performance Indicators for this object.
A character string length |
Label |
A short label for the Performance Indicators for this object. Used to label axes on charts.
Can be longer than |
Description |
A description for the Performance Indicators for this object.
Can include Markdown, see |
Value |
A numeric array with the stochastic performance indicator values for each
operating model (OM), management procedure (MP), and performance indicator (PI)
Dimensions: c( |
Preset |
An optional named list for the preset buttons in the |
Slick |
A |
value |
A |
Details
Objects of class Tradeoff
are created with Tradeoff()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Functions
-
Tradeoff(missing)
: Create an emptyTradeoff
object -
Tradeoff(character)
: Create a populatedTradeoff
object -
Tradeoff(list)
: Create a populatedTradeoff
object -
Tradeoff(Slick)
: ReturnTradeoff
from aSlick-class()
object -
Tradeoff(Slick) <- value
: Assign aTradeoff-class()
object to aSlick-class()
object
See Also
Code()
, Label()
, Description()
, Metadata()
, Value()
, Preset()
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- rlnorm(1,log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
tradeoff <- Tradeoff(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(tradeoff)
# Add to `Slick` object
slick <- Slick()
Tradeoff(slick) <- tradeoff
# Plots
plotTradeoff(slick)
plotTradeoff(slick, c(1,1,2), c(2,3,3))
S4 class Tradeoff
Description
Objects of class Tradeoff
are used to store information for the Tradeoff plot.
Like all S4 objects in Slick
, slots in this object can be accessed and
assigned using functions corresponding to slot name. See Tradeoff()
and the
the See Also
section below.
Details
Objects of class Tradeoff
are created with Tradeoff()
Multi-Language Support
Text with multi-language supported can be provided as a named list. Available languages:
-
en
: English (default) -
es
: Spanish -
fr
: French
Note
Character strings in Code
, Label
, and Description
must all be same length
as the number of performance indicators (nPIs
) in Value
Slots
Code
A short code for the Performance Indicators for this object. A character string length
nPI
or a named list for multi-language support. SeeDetails
Label
A short label for the Performance Indicators for this object. Used to label axes on charts. Can be longer than
Code
but recommended to keep short as possible so it shows clearly in plots and tables. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Description
A description for the Performance Indicators for this object. Can include Markdown, see
Examples
. A character string lengthnPI
or a named list for multi-language support. SeeDetails
Value
A 3 dimensional numeric array with the stochastic performance indicator values for operating model (OM), management procedure (MP), and performance indicator (PI). Dimensions: c(
nOM
,nMP
, andnPI
)Preset
An optional named list for the preset buttons in the
App()
. The name of the list element will appear as a button in theApp()
.
See Also
Tradeoff()
, Code()
, Label()
, Description()
,
Value()
, Preset()
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- rlnorm(1,log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
tradeoff <- Tradeoff(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(tradeoff)
# Add to `Slick` object
slick <- Slick()
Tradeoff(slick) <- tradeoff
# Plots
plotTradeoff(slick)
plotTradeoff(slick, c(1,1,2), c(2,3,3))
Updates an old object of class Slick
to new S4 class Slick
Description
Updates an old object of class Slick
to new S4 class Slick
Usage
Update(slick)
Arguments
slick |
An S3 object of class |
Value
An S4 object of class Slick
Examples
slick <- Slick() # a dummy old Slick object
slick <- Update(slick) # updated to S4 object
Assign or access Value
for a valid object class
Description
Assign or access Value
for a valid object class
Usage
Value(object)
Value(object) <- value
## S4 method for signature 'Boxplot'
Value(object)
## S4 replacement method for signature 'Boxplot'
Value(object) <- value
## S4 method for signature 'Kobe'
Value(object)
## S4 replacement method for signature 'Kobe'
Value(object) <- value
## S4 method for signature 'Quilt'
Value(object)
## S4 replacement method for signature 'Quilt'
Value(object) <- value
## S4 method for signature 'Tradeoff'
Value(object)
## S4 replacement method for signature 'Tradeoff'
Value(object) <- value
## S4 method for signature 'Timeseries'
Value(object)
## S4 replacement method for signature 'Timeseries'
Value(object) <- value
## S4 method for signature 'Spider'
Value(object)
## S4 replacement method for signature 'Spider'
Value(object) <- value
Arguments
object |
An object of class |
value |
An |
Value
Returns a numeric array with the contents of the Value
slot of object
Methods (by class)
-
Value(Boxplot)
: ReturnValue
from aBoxplot-class()
object -
Value(Boxplot) <- value
: AssignValue
to aBoxplot-class()
object -
Value(Kobe)
: ReturnValue
from aKobe-class()
object -
Value(Kobe) <- value
: AssignValue
to aKobe-class()
object -
Value(Quilt)
: ReturnValue
from aQuilt-class()
object -
Value(Quilt) <- value
: AssignValue
to aQuilt-class()
object -
Value(Tradeoff)
: ReturnValue
from aTradeoff-class()
object -
Value(Tradeoff) <- value
: AssignValue
to aTradeoff-class()
object -
Value(Timeseries)
: ReturnValue
from aTimeseries-class()
object -
Value(Timeseries) <- value
: AssignValue
to aTimeseries-class()
object -
Value(Spider)
: ReturnValue
from aSpider-class()
object -
Value(Spider) <- value
: AssignValue
to aSpider-class()
object
Set Default Colors for the MPs
Description
Requires the colorspace
package
Usage
default_mp_colors(nMP)
Arguments
nMP |
The number of management procedures |
Value
A character vector of length nMP
with color hex codes
Examples
cols <- default_mp_colors(4)
cols
Get Case Studies from the SlickLibrary GitHub Repo
Description
Get Case Studies from the SlickLibrary GitHub Repo
Usage
get_casestudies()
download_casestudy(
name,
case_studies = NULL,
dir = NULL,
silent = FALSE,
object = TRUE,
delete = object
)
Arguments
name |
The name of the case study to download. |
case_studies |
optional. Dataframe returned by |
dir |
Optional. Directory to save the file. Defaults to a temporary directory |
silent |
Logical. Print out messages? |
object |
Logical. Return the Slick object? Default downloads Slick object to a temporary location, loads and returns the Slick object, and then deletes downloaded file. |
delete |
Logical. Delete the downloaded file after function finishes? Only useful if |
Value
A data.frame for get_casestudies
and a Slick
object for download_casestudy
The downloaded Slick
object if object==TRUE
, otherwise nothing.
Functions
-
download_casestudy()
: download a case study file
Examples
case_studies <- get_casestudies()
slick <- download_casestudy(case_studies$Name[1])
Plot Boxplot
Description
Plots boxplot, violin plot, or a combined box+violin plot for information stored in a Boxplot object
Usage
plotBoxplot(
slick,
PI = NULL,
type = c("boxplot", "violin", "both", "all"),
byOM = FALSE,
ncol = 4,
MP_label = "Code",
PI_label = "Code"
)
Arguments
slick |
A |
PI |
Numeric value indicating the Performance Indicator(s) to plot from the |
type |
Character string specifying the plot type. |
byOM |
Logical. Facet the plots by operating model? PI must be a single value |
ncol |
Numeric. Number of columns |
MP_label |
Label to use for the MPs. Either |
PI_label |
Label to use for the PIs. Either |
Value
A ggplot2
object, or a list of ggplot2
objects
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 3
values <- array(NA, dim=c(nsim, nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[,om, mp, pi] <- rlnorm(nsim, log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
boxplot <- Boxplot(Code=c('PI1', 'PI2', 'PI3'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3'),
Value=values)
# Check
Check(boxplot)
# Add to `Slick` object
slick <- Slick()
Boxplot(slick) <- boxplot
# Plots
plotBoxplot(slick)
plotBoxplot(slick, type='violin')
plotBoxplot(slick, byOM=TRUE)
plotBoxplot(slick, 2, type='both', byOM=TRUE)
Plot Kobe
Description
Plots a Kobe plot for a given projection year, or a Kobe Time plot.
Usage
plotKobe(
slick,
xPI = 1,
yPI = 2,
Time = FALSE,
BLcol = "#F8DC7A",
TLcol = "#D8775D",
TRcol = "#FDBD56",
BRcol = "#67C18B",
axis_label = "Code",
percentile = 0.9,
axis.text.size = 14,
axis.title.size = 16,
strip.text.size = 16,
strip.text.color = "#D6501C",
incMP_label = TRUE,
mp.text.size = 7,
mp.point.size = 4,
mp.init.point.size = 2,
xmax = 2,
ymax = 2,
hist_traj = FALSE,
ncol = 4,
lang = "en",
MP_label = "Code"
)
Arguments
slick |
A |
xPI |
Numeric value specifying the performance indicator for the x-axis |
yPI |
Numeric value specifying the performance indicator for the y-axis |
Time |
Logical. Kobe Time plot? |
BLcol |
Color for the bottom left quadrant |
TLcol |
Color for the top left quadrant |
TRcol |
Color for the top right quadrant |
BRcol |
Color for the bottom right quadrant |
axis_label |
Label to use for the axes. Either |
percentile |
Numeric value specifying the percentile for the x and y percentile bars. Use NULL to remove percentile lines. |
axis.text.size |
Font size for axis text |
axis.title.size |
Font size for axis title |
strip.text.size |
Font size for facet strip text |
strip.text.color |
Color for facet strip text |
incMP_label |
Logical. Include MP labels? |
mp.text.size |
Font size for MP labels |
mp.point.size |
Point size for MP labels |
mp.init.point.size |
Point size for start of trajectory. If |
xmax |
Maximum value for the x-axis. Values greater than |
ymax |
Maximum value for the yx-axis. Values greater than |
hist_traj |
Logical. Plot the historical trajectories? |
ncol |
Numeric. Number of columns for Kobe Time |
lang |
Optional. Language (if supported in Slick Object). Either 'en', 'es', 'fr' |
MP_label |
Label to use for the MPs. Either |
Details
By default plotKobe
shows the terminal projection year.
TimeTerminal(Kobe)
can be used to override this. Use a numeric value indicating the time
(must match a value in Time(Kobe)
) to use for the Kobe
plot.
Value
A ggplot2
object
See Also
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 2
nTS <- 30
values <- array(NA, dim=c(nsim, nOM, nMP, nPI, nTS))
pi_means <- c(1,1)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[,om, mp, pi,] <- pi_means[pi] *
matrix(
cumprod(c(rlnorm(nTS*nsim, 0, 0.05))),
nrow=nsim)
}
}
}
# Create and populate Object
kobe <- Kobe(Code=c('B/BMSY', 'F/FMSY'),
Label=c('B/BMSY',
'F/FMSY'),
Description = c('This is the description for PI 1',
'This is the description for PI 2'),
Value=values
)
# Add values for projection time steps
Time(kobe) <- seq(2025, by=1, length.out=nTS)
# Check
Check(kobe)
# Add to `Slick` object
slick <- Slick()
Kobe(slick) <- kobe
# Plots
plotKobe(slick)
plotKobe(slick, Time=TRUE)
Plot Quilt
Description
Create a Quilt plot (unless shading==FALSE
in which case it's just a table)
Usage
plotQuilt(
slick,
MP_label = "Code",
minmax = FALSE,
shading = TRUE,
kable = FALSE,
signif = 2,
alpha = 0.5
)
Arguments
slick |
A |
MP_label |
Label to use for the MPs. Either |
minmax |
Logical. Color shading from min to max values in each column?
If TRUE, ignores |
shading |
Logical. Color shading for the columns? |
kable |
Logical. Return a |
signif |
Numeric Number of significant figures |
alpha |
Numeric value. Transparency for color shading |
Details
The columns are color shaded from light (lowest values) to dark (highest values).
Colors are set in Color(quilt)
.
The color shading has 10 steps, from MinValue(quilt)
to MaxValue(quilt)
for each
Performance Indicator. If those values are missing (NA
) for a given PI, colors
are shaded from lowest to highest values. If minmax==TRUE
, MinValue(quilt)
and MaxValue(quilt)
are ignored.
Value
A DT::datatable
or a knitr::kable
object
See Also
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- rlnorm(1,log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
quilt <- Quilt(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(quilt)
# Add to `Slick` object
slick <- Slick()
Quilt(slick) <- quilt
# Plots
plotQuilt(slick)
Plot Spider
Description
A Spider or Radar plot
Usage
plotSpider(
slick,
byOM = FALSE,
byMP = FALSE,
incMean = TRUE,
incMax = TRUE,
relScale = FALSE,
col.om.title = "#D6501C",
cex.om.title = 2,
col.Mean = "white",
bg.Mean = "black",
grid.fill = "#f2f3f5",
grid.line = "black",
fill = byMP | all(byOM),
inc.grid = TRUE,
PI.labels = !(byMP | all(byOM)),
MP_label = "Code",
mp.lwd = 3,
alpha = 0.3,
ncol = 4,
PI.mean.cex = 2.2,
incMPtitle = byMP,
mplab.cex = 2.2,
max.pt.cex = 2,
max.pt.col = "darkred"
)
Arguments
slick |
A |
byOM |
Logical Plot by OM? Otherwise mean over OMs |
byMP |
Logical. Plot by MP? Otherwise all MPs together on one plot |
incMean |
Logical. Include mean PI score in center? |
incMax |
Logical. Include colored points indicating maximum PI values? |
relScale |
Logical. Scale PI values between minimum (0) and maximum (1)? |
col.om.title |
Color of the OM names/labels |
cex.om.title |
Size of OM names/labels |
col.Mean |
Color of mean value text |
bg.Mean |
Background color of mean value text |
grid.fill |
Color of fill for the spider grid |
grid.line |
Color of lines for the spider grid |
fill |
Logical Fill the spider plot? |
inc.grid |
Logical. Include the grid? |
PI.labels |
Logical Show PI labels? |
MP_label |
Label to use for the MPs. Either |
mp.lwd |
Line width |
alpha |
Alpha value for the fill |
ncol |
Number of columns |
PI.mean.cex |
Size of PI mean score text |
incMPtitle |
Logical. Include MP label? |
mplab.cex |
MP label size |
max.pt.cex |
Max value point size |
max.pt.col |
Max value point color |
Value
A ggplot2
object
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
# Note: PI values must be between 0 and 1, with 1 indicating better performance
pi_means <- runif(nPI, 0, 1)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- runif(1, pi_means[pi])
}
}
}
# Create and populate Object
spider <- Spider(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(spider)
# Add to `Slick` object
slick <- Slick()
Spider(slick) <- spider
# Plots
plotSpider(slick)
plotSpider(slick, fill=TRUE)
plotSpider(slick, byMP=TRUE)
plotSpider(slick, byOM=TRUE)
Plot Timeseries
Description
Plot the historical and projected values for a performance indicator.
Usage
plotTimeseries(
slick,
PI = 1,
byMP = FALSE,
byOM = FALSE,
includeHist = TRUE,
ncol = 4,
col_line = "darkgray",
includeQuants = TRUE,
includeLabels = TRUE,
MeanMed = c("mean", "median"),
fill_ribbon1 = "#ededed",
col_ribbon1 = "#ededed",
quants1 = c(0.25, 0.75),
alpha1 = 0.3,
fill_ribbon2 = "white",
col_ribbon2 = "#c9c9c9",
linetype_ribbon2 = "dashed",
quants2 = c(0.1, 0.9),
alpha2 = 0.1,
MP_label = "Code",
col_title = "#D6501C",
size.title = 18,
size.axis.title = 18,
size.axis.text = 16,
size.mp.label = 6,
linewidth.median.line = 0.5,
targ_color = "green",
targ_name = "Target",
lim_color = "red",
lim_name = "Limit",
inc_y_label = TRUE,
sims = NULL,
lang = "en"
)
Arguments
slick |
A |
PI |
A numeric value specifying the performance indicator to plot |
byMP |
Logical. Facet by MP? Defaults to FALSE, where all MPs are shown on the same plot |
byOM |
Logical. Facet by OM? Defaults to FALSE where values are calculated as mean across OMs |
includeHist |
Logical. Include the historical period in the projections? |
ncol |
Numeric. Number of columns if faceting by MP or OM |
col_line |
Color for the median line (historical) |
includeQuants |
Logical. Include quantile shading for the projections? |
includeLabels |
Logical. Include MP labels? |
MeanMed |
Character. Plot the |
fill_ribbon1 |
Fill color for the inner ribbon |
col_ribbon1 |
Color of the line for inner ribbon |
quants1 |
Quantiles for the inner ribbon. Numeric length 2 |
alpha1 |
Alpha for the colored MPs inner shading |
fill_ribbon2 |
Fill color for the outer ribbon |
col_ribbon2 |
Color of the line for outer ribbon |
linetype_ribbon2 |
Line type for outer ribbon |
quants2 |
Quantiles for the outer ribbon. Numeric length 2. |
alpha2 |
Alpha for the colored MPs outer shading |
MP_label |
Label to use for the MPs. Either |
col_title |
Color of the MP title (if |
size.title |
Numeric length 1. Size for plot title |
size.axis.title |
Numeric length 1. Size for axis title |
size.axis.text |
Numeric length 1. Size for axis text |
size.mp.label |
Numeric length 1. Size of MP labels. Set to NULL for no MP labels |
linewidth.median.line |
Width of the mean/median line |
targ_color |
Color for the target line (if it exists in |
targ_name |
Label for the target line |
lim_color |
Color for the limit line (if it exists in |
lim_name |
Label for the limit line |
inc_y_label |
Include the label for the y-axis? |
sims |
Optional. Numeric values indicating the simulations to include. Defaults to all. |
lang |
Optional. Language (if supported in Slick Object). Either 'en', 'es', 'fr' |
Details
If byOM==FALSE
the results are shown as the mean across operating models.
Value
A ggplot2
object
See Also
Timeseries()
, Timeseries-class()
Examples
# Generate dummy values
nsim <- 10
nOM <- 2
nMP <- 4
nPI <- 3
nHistTS <- 50
nProjTS <- 30
nTS <- nHistTS + nProjTS
set.seed(101)
values <- array(NA, dim=c(nsim, nOM, nMP, nPI, nTS))
pi_means <- c(1,1, 1000)
for (om in 1:nOM) {
for (pi in 1:nPI) {
# PI identical for historical
histVals <- matrix(
pi_means[pi] *
cumprod(c(rlnorm(nHistTS*nsim, 0, 0.05))),
nrow=nsim, ncol=nHistTS, byrow=TRUE)
histVals <- replicate(nMP, histVals)
values[,om, , pi,1:nHistTS] <- aperm(histVals, c(1,3,2))
for (mp in 1:nMP) {
values[,om, mp, pi,(nHistTS+1):nTS] <- matrix(
pi_means[pi] *
cumprod(c(rlnorm(nProjTS*nsim, 0, 0.05))),
nrow=nsim, ncol=nProjTS, byrow=FALSE)
}
}
}
# Create and populate Object
timeseries <- Timeseries(Code=c('B/BMSY', 'F/FMSY', 'TAC'),
Label=c('B/BMSY',
'F/FMSY',
'TAC'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3'),
Value=values
)
# Last historical time step
TimeNow(timeseries) <- 2024
# Add values for time steps
Time(timeseries) <- c(rev(seq(TimeNow(timeseries), by=-1, length.out=nHistTS)),
seq(TimeNow(timeseries)+1, by=1, length.out=nProjTS))
# Check
Check(timeseries)
# Add to `Slick` object
slick <- Slick()
Timeseries(slick) <- timeseries
# Plots
plotTimeseries(slick)
plotTimeseries(slick, 2)
plotTimeseries(slick, 3)
plotTimeseries(slick, byMP=TRUE)
plotTimeseries(slick, byOM=TRUE)
# Custom Reference Points
RefPoints(timeseries) <- list(
list(Name=c('0.5 BMSY', 'BMSY', '1.5 BMSY'),
Value=c(0.5, 1, 1.5),
Color=c('red', 'orange', 'green')),
list(Name=c('0.8 FMSY', 'FMSY'),
Value=c(0.8,1),
Color=c('orange', 'red')),
list(Name='Target Catch',
Value=1200,
Color='blue')
)
Timeseries(slick) <- timeseries
plotTimeseries(slick)
plotTimeseries(slick, 2)
plotTimeseries(slick, 3)
Plot Tradeoff
Description
Plot Tradeoff
Usage
plotTradeoff(
slick,
xPI = NULL,
yPI = NULL,
MP_label = "Code",
lab_size = 6,
point_size = 2,
size.axis.title = 14,
size.axis.text = 12
)
Arguments
slick |
A |
xPI |
Numeric value indicating the PI to plot on the x-axis. Multiple values are accepted. Recycled if |
yPI |
Numeric value indicating the PI to plot on the y-axis. Multiple values are accepted. Recycled if |
MP_label |
Label to use for the MPs. Either |
lab_size |
Size of the MP labels |
point_size |
Size of the points |
size.axis.title |
Size of axis title |
size.axis.text |
Size of axis text |
Value
A ggplot2
object
Examples
# Generate dummy values
nOM <- 2
nMP <- 4
nPI <- 4
values <- array(NA, dim=c(nOM, nMP, nPI))
pi_means <- runif(nPI, 5, 50)
for (om in 1:nOM) {
for (mp in 1:nMP) {
for (pi in 1:nPI) {
values[om, mp, pi] <- rlnorm(1,log(pi_means[pi]), 0.4)
}
}
}
# Create and populate Object
tradeoff <- Tradeoff(Code=c('PI1', 'PI2', 'PI3', 'PI4'),
Label=c('Performance Indicator 1',
'Performance Indicator 2',
'Performance Indicator 3',
'Performance Indicator 4'),
Description = c('This is the description for PI 1',
'This is the description for PI 2',
'This is the description for PI 3',
'This is the description for PI 4'),
Value=values)
# Check
Check(tradeoff)
# Add to `Slick` object
slick <- Slick()
Tradeoff(slick) <- tradeoff
# Plots
plotTradeoff(slick)
plotTradeoff(slick, c(1,1,2), c(2,3,3))
Generic show method
Description
A copy of methods::show()
Usage
show(object)
## S4 method for signature 'Boxplot'
show(object)
## S4 method for signature 'CheckList'
show(object)
## S4 method for signature 'Kobe'
show(object)
## S4 method for signature 'MPs'
show(object)
## S4 method for signature 'OMs'
show(object)
## S4 method for signature 'Quilt'
show(object)
## S4 method for signature 'Tradeoff'
show(object)
## S4 method for signature 'Timeseries'
show(object)
## S4 method for signature 'Spider'
show(object)
## S4 method for signature 'Slick'
show(object)
Arguments
object |
Object to print to console |
Value
show
returns an invisible NULL
Methods (by class)
-
show(Boxplot)
: Print aBoxplot-class()
object -
show(CheckList)
: Print aCheckList
object -
show(Kobe)
: Print aKobe-class()
object -
show(MPs)
: Print aMPs-class()
object -
show(OMs)
: Print aOMs-class()
object -
show(Quilt)
: Print aQuilt-class()
object -
show(Tradeoff)
: Print aTradeoff-class()
object -
show(Timeseries)
: Print aTimeseries-class()
object -
show(Spider)
: Print aSpider-class()
object -
show(Slick)
: Print aSlick-class()
object