Create a Quilt plot (unless shading==FALSE in which case it's just a table)
Usage
plotQuilt(
slick,
MP_label = "Code",
OMs = NA,
minmax = FALSE,
shading = TRUE,
kable = FALSE,
signif = 3,
alpha = 0.5
)Arguments
- slick
A
Slick-class()object- MP_label
Label to use for the MPs. Either
CodeorLabel.Descriptionworks as well, but you probably don't want to do that.- OMs
Integers representing the OMs to include in the plot. Defaults to all.
- minmax
Logical. Color shading from min to max values in each column? If TRUE, ignores
MinValue(quilt)andMaxValue(quilt)- shading
Logical. Color shading for the columns?
- kable
Logical. Return a
kableobject?- signif
Numeric Number of significant figures
- alpha
Numeric value. Transparency for color shading
Value
A DT::datatable or a knitr::kable object
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.
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