convertCodes: convert entries in a rollcall matrix to binary form

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Convert roll call matrix to binary form using encoding information.

Usage

1
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.

Details

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

Value

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

Note

Any entries in the votes matrix that can not be mapped into c(0,1,NA) using the information in codes are mapped to NA, with an informative message sent to the console.

Author(s)

Simon Jackman jackman@stanford.edu

See Also

rollcall

Examples

1
2
3
  data(s109)
  mat <- convertCodes(s109)
  table(mat,exclude=NULL)


Search within the pscl package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.