Skip to contents

This function creates a scatter plot of legislators' ideal points for a given roll call vote. It allows for the visualization of voting patterns, highlighting errors, and optionally adding shape variation for different groups of legislators.

Usage

plot_rollcall(
  obj,
  data,
  gdat,
  rcnum,
  shapeVar = NULL,
  dropNV = FALSE,
  onlyErrors = FALSE,
  ptSize = 4
)

Arguments

obj

An object of class nomObject containing the results of a NOMINATE analysis, including legislators' ideal points and roll call data.

data

A data frame containing the roll call data, including vote outcomes and codes for "yea" and "nay" votes.

gdat

A data frame containing additional data related to the legislators. (This parameter is currently not used in the function but can be included for future extensions.)

rcnum

An integer specifying the roll call number to be plotted.

shapeVar

An optional variable used to differentiate groups of legislators by shape in the plot. If provided, the points will be shaped according to this variable.

dropNV

A logical value indicating whether to drop non-voters (NA values) from the plot. Default is FALSE.

onlyErrors

A logical value indicating whether to plot only the legislators who made voting errors. Default is FALSE.

ptSize

A numeric value specifying the size of the points in the plot. Default is 4.

Value

A ggplot object showing the roll call results, including the voting patterns of legislators.

Examples

if (FALSE) { # \dontrun{
g <- plot_rollcall(result, hr108, gdat = NULL, rcnum = 528)
print(g)
} # }