Learn R Programming

ufs (version 0.5.12)

irpplot: Visualising individual response patterns

Description

Visualising individual response patterns

Usage

irpplot(
  data,
  row,
  columns,
  dataName = NULL,
  title = paste("Row", row, "in dataset", dataName)
)

Value

A ggplot2::ggplot().

Arguments

data

A dataframe with the dataset containing the responses.

row

A vector with indices of the rows for which you want the individual response patterns. These can be either the relevant row numbers, or if character row names are set, the names ot the rleevant rows.

columns

A vector with the names of the variables you want the individual response patterns for.

dataName, title

Optionally, you can override the dataset name that is used in the title; or, the title (the dataset name is only used in the title).

Examples

Run this code
### Get a dataset
dat <- ufs::bfi;

### Show the individual responses for
### the tenth participant
irpplot(dat, 10, 1:20);

### Set some missing values
dat[10, c(1, 5, 15)] <- NA;

### Show the individual responses again
irpplot(dat, 10, 1:20);

Run the code above in your browser using DataLab