plot.RprobitB_data: Visualize choice data

View source: R/plot.R

plot.RprobitB_dataR Documentation

Visualize choice data

Description

This function is the plot method for an object of class RprobitB_data.

Usage

## S3 method for class 'RprobitB_data'
plot(x, by_choice = FALSE, alpha = 1, position = "dodge", ...)

Arguments

x

An object of class RprobitB_data.

by_choice

Set to TRUE to group the covariates by the chosen alternatives.

alpha, position

Passed to ggplot.

...

Ignored.

Value

No return value. Draws a plot to the current device.

Examples

data <- simulate_choices(
  form = choice ~ cost | 0,
  N = 100,
  T = 10,
  J = 2,
  alternatives = c("bus", "car"),
  true_parameter = list("alpha" = -1)
)
plot(data, by_choice = TRUE)

loelschlaeger/RprobitB documentation built on Oct. 15, 2024, 11:08 a.m.