Learn R Programming

pscl (version 1.5.2)

convertCodes: convert entries in a rollcall matrix to binary form

Description

Convert roll call matrix to binary form using encoding information.

Usage

convertCodes(object, codes = object$codes)

Arguments

object

rollcall object

codes

list, mapping entries in the votes component of rollcall object to 0 (‘Nay’), 1 (‘Yea’) and NA (missing, abstentions, etc). Defaults to the codes component of the rollcall object.

Value

a matrix with dimensions equal to the dimensions of the votes component of the rollcall object.

Details

See rollcall for details on the form of the codes list.

See Also

rollcall

Examples

Run this code
# NOT RUN {
  data(s109)
  mat <- convertCodes(s109)
  table(mat,exclude=NULL)
# }

Run the code above in your browser using DataLab