Draws a DMU-by-variable heatmap of the input and output values, with DMUs on
the y-axis and variables on the x-axis (inputs labelled I_, outputs
O_). By default the values are standardised column-wise so they are
comparable across variables.
Usage
plot_io_heatmap(
x,
scale = TRUE,
labels = "all",
max.overlaps.value = 10,
transparency = 1,
fade = TRUE,
x_angle = NULL,
subtitle = NULL,
title = NULL,
interactive = FALSE,
...
)Arguments
- x
A
dea_dataobject, or a data frame coerced byas_dea_data.- scale
Logical; if
TRUE(default) each variable is standardised (z-scored) before plotting.- labels
DMU tick labels:
"all"(default) shows them,"none"hides them, and the name/id of a single DMU highlights that DMU's label(s) in colour.- max.overlaps.value
Accepted for API consistency; unused here (default
10).- transparency
Opacity of the markers/areas, a single number in
[0, 1](default1).- fade
Controls the single-DMU focus view. When one DMU is given to
labels, all other marks (and, for the network plots, everything outside that DMU's sub-network; for the panel biplot, the other trajectories) are faded so the chosen DMU stands out.TRUE(default) uses a sensible fade level;FALSEdisables it; a single number in[0, 1]sets the alpha of the faded marks directly, where larger values fade them less (e.g.0.4leaves them more visible).- x_angle
Angle in degrees for the x-axis tick labels, useful when the input/output (or DMU) names on the x-axis are long and overlap.
NULL(default) keeps the plot's standard orientation; for examplex_angle = 45tilts the labels to make them readable.- subtitle
Optional subtitle shown beneath the title.
- title
Optional plot title.
- interactive
Logical; static ggplot2 (default) or interactive plotly.
- ...
Additional arguments passed to
geom_tile.
Examples
df <- data.frame(
dmu = paste0("D", 1:6),
i_x1 = c(4, 7, 8, 4, 2, 5),
i_x2 = c(3, 3, 1, 2, 4, 2),
o_y = c(5, 8, 6, 7, 3, 9)
)
plot_io_heatmap(df)