Git Product home page Git Product logo

proporz's People

Contributors

polettif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

proporz's Issues

Release proporz 1.4.0

Content:

  • finish #7
  • Cleanup dataset documentation, add references
  • Combine documentations (pivot_to_*, divisor_methods, quorum_functions)
  • update method list and links in README

First release:

  • usethis::use_news_md()
  • update news.md
  • usethis::use_cran_comments()
  • Update (aspirational) install instructions in README
  • Proofread Title: and Description:
  • Check that all exported functions have @return and @examples
  • Check that Authors@R: includes a copyright holder (role 'cph')
  • add author role to Authors@R
  • Check licensing of included files
  • Review https://github.com/DavisVaughan/extrachecks

Prepare for release:

  • git pull
  • usethis::use_github_links()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • git push

Submit to CRAN:

  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()

Party seats seem inaccurate

I feel like there is something off with the party divisors:

The seats allocated to each party differ more than they should from their share of votes. Please see attached the data I used.
votes_FIN_2019.xlsx
district_seats_FIN_2019.xlsx

Using a 0.5 % national treshold, e.g. party "RKP" should land 9 seats, but using pukelsheim only gives them 7.
"VAS" should be entitled to 17 due to their share, but they get 18 etc.

The specs I use:

seats_df = pukelsheim(votes_df,
                      district_seats_df,
                      quorum_districts = 0,
                      quorum_total = 0.005)

Here is how precise results I got by finding the divisors by hand:
result_Pukelsheim_by_hand_FIN_2019.xlsx

Am I missing something? Thanks for your patience!

Limited divisor range in lower_apportionment

The following input data leads to an error in biproportional.R#252:

library(proporz)
df_votes = structure(
    list(list_id = c("SDP", "PS", "KOK", "PS", "KOK", "SDP", "KOK", "SDP", "PS"),
         entity_id = c("HEL", "UUS", "HAEM", "HEL", "UUS", "HAEM", "HEL", "UUS", "HAEM"),
         list_votes = c(4000, 9000, 17000, 23000, 29500, 36000, 42500, 49000, 17999)),
    row.names = c(NA, -9L), class = "data.frame")
df_district_seats = structure(
    list(entity_id = c("HEL", "UUS", "HAEM"),
         election_mandates = c(5, 10, 15)),
    row.names = c(NA, -3L), class = "data.frame")

pukelsheim(df_votes, df_district_seats)
#> Error in bisect(fun, divisor_range[1], divisor_range[2], tol): 
#> (f(x1) <= 0 & f(x2) >= 0) | (f(x1) >= 0 & f(x2) <= 0) is not TRUE

Created on 2020-07-22 by the reprex package (v0.3.0)

Quorum flexibility

While working with your library, I found an issue calculating seat allocation for Zurich's cantonal elections. The canton of Zurich sets the quorum at either 0.05 in at least 1 district or 0.03 overall. The pukelsheim function, however, does not allow for that. It would be great if you could add this option to the function.

Thank you for the amazing work!

Release proporz 1.5.0

Prepare for release:

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()

add vignettes

Add vignettes for the readme examples and especially the analysis done in finland-comparison.md

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.