Methods for Creating, Accessing and Assigning MPs
objects
MPs-methods.Rd
The MPs
function is used both to create and modify an MPs-class()
object.
and to access and assign MPs
for an object of class Slick-class()
.
See Details
.
Usage
MPs(Code = "", Label = "", Description = "", Color = "", Preset = list())
MPs(object) <- value
# S4 method for class 'missing'
MPs()
# S4 method for class 'character_list'
MPs(Code = "", Label = "", Description = "", Color = "", Preset = list())
# S4 method for class 'Slick'
MPs(Code)
# S4 method for class 'Slick'
MPs(object) <- value
Arguments
- Code
A short code for the Management Procedures in this
Slick
object. A character string lengthnMP
or a named list for multi-language support. SeeDetails
- Label
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
- Description
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.
- 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()
.Use
Code()
,Label()
,Description()
, andPreset()
to access and assign the values for an existingMPs
object, seeExamples
.- object
A
Slick-class()
object- value
A
MPs-class()
object
Functions
MPs(missing)
: Create an emptyMPs
objectMPs(character_list)
: Create a populatedMPs
objectMPs(Slick)
: Return anMPs-class()
object from aSlick()
objectMPs(Slick) <- value
: Assign anMPs-class()
object to aSlick()
object
Examples
myMPs <- MPs()
Code(myMPs) <- c('MP1', 'MP2', 'MP3')
Label(myMPs) <- c('Management Procedure 1',
'Management Procedure 2',
'Management Procedure 3')
Description(myMPs) <- c('This is the description for Management Procedure 1',
'This is the description for Management Procedure 2',
'This is the description for Management Procedure 3')
Preset(myMPs) <- list(All=1:3, FirstTwo=1:2)
myMPs
#>
#> ── An object of class `MPs` ────────────────────────────────────────────────────
#>
#> ── `Code` ──
#>
#> 1 MP1
#> 2 MP2
#> 3 MP3
#>
#> ── `Label` ──
#>
#> 1 Management Procedure 1
#> 2 Management Procedure 2
#> 3 Management Procedure 3
#>
#> ── `Description` ──
#>
#> 1 This is the description for Management P ...
#> 2 This is the description for Management P ...
#> 3 This is the description for Management P ...
#>
#> ── `Color` ──
#>
#> 1 #C87A8A
#> 2 #6B9D59
#> 3 #5F96C2
#>
#> ── `Preset` ──
#>
#> ── All
#> 1
#> 2
#> 3
#>
#> ── FirstTwo
#> 1
#> 2
# Multi-language
Description(myMPs) <- list(en=c('This is the English description for Management Procedure 1',
'This is the English description for Management Procedure 2',
'This is the English description for Management Procedure 3'),
es=c("This is the Spanish description for Management Procedure 1",
"This is the Spanish description for Management Procedure 2",
"This is the Spanish description for Management Procedure 3"),
fr=c("This is the French description for Management Procedure 1",
"This is the French description for Management Procedure 2",
"This is the French description for Management Procedure 3")
)
Metadata(myMPs)
#> Code Label
#> 1 MP1 Management Procedure 1
#> 2 MP2 Management Procedure 2
#> 3 MP3 Management Procedure 3
#> Description Color
#> 1 This is the English description for Management Procedure 1 #C87A8A
#> 2 This is the English description for Management Procedure 2 #6B9D59
#> 3 This is the English description for Management Procedure 3 #5F96C2
Metadata(myMPs, 'es')
#> Code Label
#> 1 MP1 Management Procedure 1
#> 2 MP2 Management Procedure 2
#> 3 MP3 Management Procedure 3
#> Description Color
#> 1 This is the Spanish description for Management Procedure 1 #C87A8A
#> 2 This is the Spanish description for Management Procedure 2 #6B9D59
#> 3 This is the Spanish description for Management Procedure 3 #5F96C2
Metadata(myMPs, 'fr')
#> Code Label
#> 1 MP1 Management Procedure 1
#> 2 MP2 Management Procedure 2
#> 3 MP3 Management Procedure 3
#> Description Color
#> 1 This is the French description for Management Procedure 1 #C87A8A
#> 2 This is the French description for Management Procedure 2 #6B9D59
#> 3 This is the French description for Management Procedure 3 #5F96C2