Methods for Creating, Accessing and Assigning Boxplot
objects
Boxplot-methods.Rd
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 missing
Boxplot()
# S4 method for character_list
Boxplot(
Code = "",
Label = "",
Description = "",
Value = array(),
Preset = list(),
Defaults = list("overall", "boxplot")
)
# S4 method for Slick
Boxplot(Code)
# S4 method for Slick
Boxplot(Slick) <- value
Arguments
- 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
- Slick
A
Slick-class()
object- value
A
Boxplot-class()
object
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
: Spanishfr
: 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
objectBoxplot(character_list)
: Create a populatedBoxplot
objectBoxplot(Slick)
: ReturnBoxplot
from aSlick-class()
objectBoxplot(Slick) <- value
: Assign aBoxplot-class()
object to aSlick-class()
object
Examples
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=array(runif(3000), dim=c(10, 10, 10,3)),
Preset=list('PI and P2'=1:2)
)
boxplot
#>
#> ── An object of class `Boxplot` ────────────────────────────────────────────────
#>
#> ── `Code` ──
#>
#> 1 PI1
#> 2 PI2
#> 3 PI3
#>
#> ── `Label` ──
#>
#> 1 Performance Indicator 1
#> 2 Performance Indicator 2
#> 3 Performance Indicator 3
#>
#> ── `Description` ──
#>
#> 1 This is the description for PI 1
#> 2 This is the description for PI 2
#> 3 This is the description for PI 3
#>
#> ── `Value` ──
#>
#> Dimension Length
#> 1 nsim 10
#> 2 nOM 10
#> 3 nMP 10
#> 4 nPI 3
#>
#> ℹ Mean across MPs and PIs
#> PI1 PI2 PI3
#> MP 1 0.52 0.48 0.50
#> MP 2 0.47 0.54 0.52
#> MP 3 0.54 0.50 0.49
#> MP 4 0.48 0.51 0.54
#> MP 5 0.51 0.50 0.52
#> MP 6 0.48 0.55 0.45
#> MP 7 0.51 0.50 0.49
#> MP 8 0.51 0.52 0.50
#> MP 9 0.47 0.50 0.55
#> MP 10 0.49 0.51 0.54
#>
#> ── `Preset` ──
#>
#> ── PI and P2
#> 1
#> 2
Code(boxplot)
#> [1] "PI1" "PI2" "PI3"
Metadata(boxplot)
#> Code Label Description
#> 1 PI1 Performance Indicator 1 This is the description for PI 1
#> 2 PI2 Performance Indicator 2 This is the description for PI 2
#> 3 PI3 Performance Indicator 3 This is the description for PI 3
# Value(boxplot)
Value(boxplot) <- array()
Preset(boxplot)
#> $`PI and P2`
#> [1] 1 2
#>
Preset(boxplot) <- list()
boxplot
#>
#> ── An object of class `Boxplot` ────────────────────────────────────────────────
#>
#> ── `Code` ──
#>
#> 1 PI1
#> 2 PI2
#> 3 PI3
#>
#> ── `Label` ──
#>
#> 1 Performance Indicator 1
#> 2 Performance Indicator 2
#> 3 Performance Indicator 3
#>
#> ── `Description` ──
#>
#> 1 This is the description for PI 1
#> 2 This is the description for PI 2
#> 3 This is the description for PI 3
#>
#> ── `Value` ──
#>
#> ── `Preset` ──
#>