plotScoreRank_gg: Plot Score-Rank Heatmap from exametrika

View source: R/ScoreRank.R

plotScoreRank_ggR Documentation

Plot Score-Rank Heatmap from exametrika

Description

This function takes exametrika LRAordinal or LRArated output as input and generates a Score-Rank heatmap using ggplot2. The heatmap shows the distribution of students across scores (y-axis) and latent ranks (x-axis), with darker cells indicating higher frequency.

Usage

plotScoreRank_gg(
  data,
  title = TRUE,
  colors = NULL,
  show_legend = TRUE,
  legend_position = "right"
)

Arguments

data

An object of class c("exametrika", "LRAordinal") or c("exametrika", "LRArated") from exametrika::LRA().

title

Logical or character. If TRUE (default), display an auto-generated title. If FALSE, no title. If a character string, use it as a custom title.

colors

Character vector of length 2. Low and high colors for the gradient. If NULL (default), white-to-black grayscale is used (matching exametrika's original output).

show_legend

Logical. If TRUE (default), display the color scale legend.

legend_position

Character. Position of the legend. One of "right" (default), "top", "bottom", "left", "none".

Details

The Score-Rank heatmap visualizes the joint distribution of observed scores and estimated latent ranks. Each cell represents the number of students with a given score assigned to a given rank. Darker cells indicate higher frequency.

The data is taken from data$ScoreRank, a matrix where rows represent scores and columns represent latent ranks.

Value

A single ggplot object showing the Score-Rank heatmap.

See Also

plotScoreFreq_gg, plotLRD_gg

Examples


library(exametrika)
result <- LRA(J5S1000, nrank = 4)
plot <- plotScoreRank_gg(result)
plot


ggExametrika documentation built on Nov. 25, 2026, 9:07 a.m.