| plotArray_gg | R Documentation |
This function takes exametrika output as input and generates array plots using ggplot2. Array plots visualize the response patterns of students (rows) across items (columns), showing both the original data and the clustered/reordered data.
Supports both binary (0/1) and multi-valued (ordinal/nominal) data.
plotArray_gg(
data,
Original = TRUE,
Clustered = TRUE,
Clustered_lines = TRUE,
Clustered_lines_color = NULL,
title = TRUE,
colors = NULL,
show_legend = NULL,
legend_position = "bottom",
border = FALSE,
border_linewidth = 0.5
)
data |
An object of class |
Original |
Logical. If |
Clustered |
Logical. If |
Clustered_lines |
Logical. If |
Clustered_lines_color |
Character. Color of the boundary lines.
If |
title |
Logical or character. If |
colors |
Character vector of colors. Supply either one colour per
valid category, in which case missing data keeps the default colour, or
one colour per level including missing data, in which case the first
element is used for missing. Default NULL uses a sequential ramp for
ordered categories and black and white for binary data.
If |
show_legend |
Logical. If |
legend_position |
Character. Position of the legend. Defaults to
"bottom": the array panels are tall, so a legend beside them wastes width.
When both panels are drawn the legend is shared, not repeated.
One of |
border |
Logical or character. If |
border_linewidth |
Numeric. Line width of the panel border.
Default is |
The array plot provides a visual representation of the biclustering result. For binary data, black cells indicate correct responses (1) and white cells indicate incorrect responses (0). For multi-valued data, different colors represent different response categories.
In a well-fitted model, the clustered plot should show a clear block diagonal pattern where high-ability students (bottom rows) answer difficult items (right columns) correctly.
When both Original and Clustered are TRUE,
a gtable (grid arrangement of the two panels side by side, drawn as a
side effect). Otherwise, a list containing the single requested
ggplot object.
plotFRP_gg, plotTRP_gg
library(exametrika)
result <- Biclustering(J35S515, nfld = 5, ncls = 6)
# Basic usage
plotArray_gg(result)
# Custom boundary line color
plotArray_gg(result, Clustered_lines_color = "blue")
# Multi-valued data with custom colors
synthetic_data <- matrix(sample(0:3, 50 * 20, replace = TRUE), nrow = 50, ncol = 20)
result_multi <- Biclustering(synthetic_data, nfld = 4, ncls = 5)
plotArray_gg(result_multi, show_legend = TRUE, Clustered_lines_color = "darkgreen")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.