Hello,
I am using the pscl package to create a roll call object, but I am finding an error, and couldn't overcome it.
The command I used is the following:
rollcall(data=mydata_rollcall$voto,
legis.names = mydata_rollcall$deputado_id,
legis.data=mydata_rollcall$government,
vote.names = mydata_rollcall$ï..idVotacao,
vote.data=mydata_rollcall$data)
It returns:
supplied legislator names do not match number of rows
in roll call matrix; will use default names
supplied vote names do not match number of columns
in roll call matrix; will use default names
Error in if (nrow(legis.data) != nrow(v)) stop("legislator data does not match number of legislators in roll call matrix") else rownames(legis.data) <- nm :
argument is of length zero
But there is no NA in any row, and the number of legislators and votes are the same.
Here is the data I am using:
mydata_rollcall<-data.frame(
stringsAsFactors = FALSE,
voto = c("0","0","0","0","1","0",
"1","1","1","0","1","1","1","1","0"),
deputado_id = c(204554L,204560L,204528L,
121948L,160508L,136811L,178835L,178836L,160559L,204545L,
204501L,178972L,204571L,204544L,160545L),
government = c("1","0","0","1","0","1",
"0","1","1","1","0","0","0","0","1"),
ï..idVotacao = c("2263410-69","2263410-69",
"2263410-69","2263410-69","2263410-69","2263410-69",
"2263410-69","2263410-69","2263410-69","2263410-69",
"2263410-69","2263410-69","2263410-69","2263410-69",
"2263410-69"),
data = c("2020-12-18","2020-12-18",
"2020-12-18","2020-12-18","2020-12-18","2020-12-18",
"2020-12-18","2020-12-18","2020-12-18","2020-12-18",
"2020-12-18","2020-12-18","2020-12-18","2020-12-18",
"2020-12-18")
)
I appreciate your help.