Learn R Programming

LikertEZ (version 0.1.0)

plot_item: Barplot with RII annotation

Description

This function generates a barplot showing the distribution of responses for a single item, with the Relative Importance Index (RII) annotated.

Usage

plot_item(responses, max_scale = 5, scale_labels = NULL)

Value

A ggplot2 bar plot with RII annotation.

Arguments

responses

Numeric vector of ordinal responses.

max_scale

Max Likert scale value (default: 5).

scale_labels

Optional vector of labels for each scale point.

Examples

Run this code
responses <- c(1, 2, 3, 4, 5, 3, 2, 1, NA)
plot_item(responses)

Run the code above in your browser using DataLab