Learn R Programming

oc (version 0.08)

plot.OCcoords: Optimal Classification Coordinate Plot

Description

plot.coords reads an Optimal Classification object in 2 user-specified dimensions and plots the coordinates of each member, applying separate colors and shapes to each party by default. A unit circle is included to emphasize the constraints on the Optimal Classification coordinates, and options to select non-party attributes of legislators are included. For a 1D OCobject object, Optimal Classification ranks are plotted against themselves, so they appear on a straight line.

Usage

plot.OCcoords(x, main.title="OC Coordinates",
    d1.title="First Dimension", d2.title="Second Dimension", dims=c(1,2),
    plotBy="party", color=TRUE, shape=TRUE, cutline=NULL, Legend=TRUE,
    legend.x=0.8, legend.y=1, ...)

Arguments

x
an OCobject output object.
main.title
string, coordinate plot title.
d1.title
string, x-axis label.
d2.title
string, y-axis label.
dims
vector of length 2, specifying the dimensions to be plotted.
plotBy
string, name of a variable in OCobject$legislators. plot.coords will plot coordinates using this variable as a selector.
color
logical, marks different groups specified by plotBy using different colors if TRUE.
shape
logical, marks different groups specified by plotBy using different shapes if TRUE.
cutline
vector, selects roll calls by row number for which a cutting line is desired.
Legend
logical, include a generic legend.
legend.x
numeric, corresponds to the 'x' argument of legend().
legend.y
numeric, corresponds to the 'y' argument of legend().
...
other arguments to symbols.

Value

  • A coordinate plot.

See Also

'oc', 'plot.OCskree', 'plot.OCangles', 'plot.OCcutlines', 'plot.OCobject'

Examples

Run this code
#This data file is the same as that obtained using:
    #data(sen90)
    #sen90oc<-oc(sen90,dims=2,polarity=c(7,2)) 

    data(sen90oc)
    summary(sen90oc)
    plot.OCcoords(sen90oc)

Run the code above in your browser using DataLab