## generate some fake roll call data
set.seed(314159265)
fakeData <- matrix(sample(x=c(0,1),size=5000,replace=TRUE),
50,100)
rc <- rollcall(fakeData)
is(rc,"rollcall") ## TRUE
rc ## print the rollcall object on screen
data(sc9497) ## Supreme Court example data
rc <- rollcall(data=sc9497$votes,
legis.names=sc9497$legis.names,
desc=sc9497$desc)
summary(rc,verbose=TRUE)
if (FALSE) {
## s107
## could use readKH for this
dat <- readLines("sen107kh.ord")
dat <- substring(dat,37)
mat <- matrix(NA,ncol=nchar(dat[1]),nrow=length(dat))
for(i in 1:103){
mat[i,] <- as.numeric(unlist(strsplit(dat[i],
split=character(0))))
}
s107 <- rollcall(mat,
yea=c(1,2,3),
nay=c(4,5,6),
missing=c(7,8,9),
notInLegis=0,
desc="107th U.S. Senate",
source="http://voteview.ucsd.edu")
summary(s107)
}
Run the code above in your browser using DataLab