#The same data set can be obtained from downloading the UN.csv
#file from legacy.voteview.com and reading it as follows:
if (FALSE) {
UN<-read.csv("UN.csv",header=FALSE,strip.white=TRUE)
}
data(UN)
UN<-as.matrix(UN)
UN[1:5,1:6]
UNnames<-UN[,1]
legData<-matrix(UN[,2],length(UN[,2]),1)
colnames(legData)<-"party"
UN<-UN[,-c(1,2)]
rc <- rollcall(UN, yea=c(1,2,3), nay=c(4,5,6),
missing=c(7,8,9),notInLegis=0, legis.names=UNnames,
legis.data=legData,
desc="UN Votes",
source="legacy.voteview.com")
# Not Run
if (FALSE) {
result<-oc(rc,polarity=1,dims=1)
plot(result)
summary(result)
}
Run the code above in your browser using DataLab