Methods for Creating, Accessing and Assigning Quilt
objects
Quilt-methods.Rd
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 class 'missing'
Quilt()
# S4 method for class '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 class 'Slick'
Quilt(Code)
# S4 method for class 'Slick'
Quilt(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 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).- Slick
A
Slick-class()
object- value
A
Quilt-class()
object
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
Functions
Quilt(missing)
: Create an emptyQuilt
objectQuilt(character_list)
: Create a populatedQuilt
objectQuilt(Slick)
: ReturnQuilt
from aSlick-class()
objectQuilt(Slick) <- value
: Assign aQuilt-class()
object to aSlick-class()
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
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)
#>
#> ── Checking: "Quilt" ──
#>
#> ✔ Complete
# Add to `Slick` object
slick <- Slick()
Quilt(slick) <- quilt
# Plots
plotQuilt(slick)
#> ℹ Note: `MPs` is empty. Using default MP names and colors
plotQuilt(slick, kable=TRUE)
#> ℹ Note: `MPs` is empty. Using default MP names and colors
MP
PI1
PI2
PI3
PI4
MP 1
9.1
27
29
22
MP 2
21.0
29
18
31
MP 3
12.0
27
11
24
MP 4
24.0
16
13
37