Coder Social home page Coder Social logo

wmay / oc Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 1.28 MB

oc — Optimal Classification Roll Call Analysis Software

Home Page: https://cran.r-project.org/package=oc

C 2.08% Fortran 85.16% R 12.75%
fortran ideal-points political-science r r-package

oc's People

Contributors

jameslo989 avatar jeffreyblewis avatar wmay avatar

Stargazers

 avatar  avatar

Forkers

kuriwaki

oc's Issues

plotting raises an error

In R >=4.2, plot.OCobject raises an error:

Error in axis(2, at = yt, ...) : 
  formal argument "at" matched by multiple actual arguments

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.