Skip to content

Is the rollcall output ordered the same way as vote.names #2

@kuriwaki

Description

@kuriwaki

It would be reassuring to have the rownames of the $rollcall output be named by the rollcall vote IDs as identified in the rollcall object. I presume it is ordered the same way as the columns of the input matrix (?), but better if it's tracked.

This is done in the legislator output:

oc/R/oc.R

Line 208 in 99c9a7b

rownames(legislators)<-rownames(rcObject$votes)

library(oc)

data(sen90)

# input data has vote IDs
head(colnames(sen90$votes))
#> [1] "Vote 1" "Vote 2" "Vote 3" "Vote 4" "Vote 5" "Vote 6"

# Run OC
sen90.1d <- oc(sen90, dims = 1, polarity = c(7))

# But output data has no rollcall IDs
head(sen90.1d$rollcall)
#>      correctYea wrongYea wrongNay correctNay        PRE normVector1D midpoints
#> [1,]         38       13        1         48 0.64102564            0     55.50
#> [2,]         47        1       13         38 0.64102564            0     55.50
#> [3,]         52        6        2         40 0.82608696            0     59.50
#> [4,]         50       22        4          6 0.07142857            0     14.75
#> [5,]         68        5        2          9 0.50000000            0     14.75
#> [6,]          2        0       15         75 0.11764706            0      3.50

Created on 2024-01-10 with reprex v2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions