plotteRvoteR: plotteRvoteR Main plotting command for the voteR package.

Description Usage Arguments Value

View source: R/plotteRvoteR.R

Description

plotteRvoteR Main plotting command for the voteR package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
plotteRvoteR(
  votersDataFrame = NA,
  altPoints = as.matrix(NA),
  competitorPoints = as.matrix(NA),
  plotIdeals = FALSE,
  plotPareto = FALSE,
  plotICs = FALSE,
  locationForICs = NA,
  plotAlts = FALSE,
  plotCompetitors = FALSE,
  plotVoronoi = FALSE,
  plotMarginalMedian = FALSE,
  precision = 0.01,
  yToXRatio = 1,
  showLegend = TRUE,
  showLegendBy = "pointTypes",
  xBounds = FALSE,
  yBounds = FALSE
)

Arguments

votersDataFrame

The voters data frame must have a specific format, and it must be an R data.frame object. There must be at least these 6 variables and they must have the following names. The order of the variables in the data.frame is not important as long as the variables have the proper names.

ID: A numeric identifier unique to the voter. xIdeal: The x coordinate of the voter's ideal point. yIdeal: The y coordinate of the voter's ideal point. minkoOrder: The Minkowski order of the voters MInkowski metric based utility function. = 1, is City Block. = 2 is Euclidian and 100 = is See ?Minkowski. xSalience: The salience of the x dimension for the voter. The dimension with the lowest salience is normalized to 1 and it is the numerarier, the salience of other dimension is measured in units of the numerarire. ySalience: The salience of the y dimension for the voter. he dimension with the lowest salience is normalized to 1 and it is the numerarier, the salience of other dimension is measured in units of the numerarire.

altPoints

A numberOfAlts x numberOfDimensions matrix. This is the matrix that contains the alternatives that the voter's are evaluating. Default: altPoints = NA.

competitorPoints

A numberOfCompetitors x numberOfDimensions matrix. This is the matrix that contains the competitor locations that the voter's are evaluating.

plotIdeals

If set to TRUE the ideal points of the voters are plotted. Default: plotIdeals = FALSE

plotPareto

If set to TRUE the Pareto set is plotted. Default: plotPareto = FALSE

plotICs

If set to TRUE the voters' indifference curves are plotted. Default: plotICs = FALSE

locationForICs

The location in the space that the indifference curves are drawn through. This is usually the status quo. plotteRvoteR() assumes that the first row in the altPoints or competitorPoints dataFrame is the point to draw ICs through if points are not supplied via this parameter. You can supply one of the other rows of altPoints or competitorPoints by using something like: locationForICs = c(altPoints$xLocation[2], altPoints$yLocation[2]). Default is locationForICs = NA.

plotAlts

If set to TRUE the alternatives in the choice set are plotted. Default: plotAlts = FALSE

plotCompetitors

If set to TRUE the competitors in the choice set are plotted. Default: plotCompetitors = FALSE

plotVoronoi

If set to TRUE the alternatives/competitors are used as the generatign points for a Voronoi Tessellation. Default: plotVoronoi = FALSE

plotMarginalMedian

If set to TRUE the marginal median (the vector of medians for each dimension) is plotted.

yToXRatio

Fixes the ratio of the two axis for plotting purposes. The number of units on the policy space represented on the y-axis that is equivalent to one unit on policy space represented on the the x-axis. Default: yToXRatio = 1. For more see ?coord_fixed().

showLegend

Show the legend by one of the following: "pointTypes" Default: "pointTypes"

xBounds

The bounds for the x dimension provided as a vector. Ex: c(-1,1). If they are not provided then ggplot() will use its defaults. Default = FALSE

yBounds

The bounds for the x dimension. Ex: c(-1,1). If they are not provided then ggplot() will use its defaults. Default = FALSE

percision

How precisely you want to trace out the voters' indifference curves. The lower the number the more accurate and smooth the indifference curve will be, but for large numbers of voters larger numbers will slow down plotting. Default: precision = .01

Value

Plots the requested attributes of a spatial voting model.


robiRagan/voteR documentation built on Feb. 27, 2020, 6:48 p.m.