https://github.com/bblodfon/fastvoter
Efficient Rcpp Voting Methods for Committee Selection in R
https://github.com/bblodfon/fastvoter
Last synced: 6 months ago
JSON representation
Efficient Rcpp Voting Methods for Committee Selection in R
- Host: GitHub
- URL: https://github.com/bblodfon/fastvoter
- Owner: bblodfon
- License: lgpl-3.0
- Created: 2024-11-19T08:55:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-03T11:14:38.000Z (over 1 year ago)
- Last Synced: 2025-12-09T08:48:15.474Z (8 months ago)
- Language: R
- Homepage: https://bblodfon.github.io/fastVoteR/
- Size: 1.38 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# fastVoteR
[](https://github.com/bblodfon/fastVoteR/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/bblodfon/fastVoteR)
[](https://CRAN.R-project.org/package=fastVoteR)
## Overview
`fastVoteR` is an R package with Efficient [Rcpp](https://github.com/rcppcore/rcpp) Voting Methods for Committee Selection.
Still **under development**.
## Installation
``` r
# CRAN version:
install.packages("fastVoteR")
# Development version from GitHub:
# install.packages("pak")
pak::pak("bblodfon/fastVoteR")
```
## Usage
```{r example}
library(fastVoteR)
# 5 candidates
candidates = paste0("V", seq_len(5))
candidates
# 4 voters
voters = list(
c("V3", "V1", "V4"),
c("V3", "V1"),
c("V3", "V2"),
c("V2", "V4")
)
voters
set.seed(42)
# voter weights
weights = c(1.1, 2.5, 0.8, 0.9)
# Approval voting (all voters equal)
rank_candidates(voters, candidates)
# Approval voting (voters unequal)
rank_candidates(voters, candidates, weights)
# Satisfaction Approval voting (voters unequal)
rank_candidates(voters, candidates, weights, method = "sav")
# Sequential Proportional Approval voting (voters equal)
rank_candidates(voters, candidates, method = "seq_pav")
```
## Related work
See [vote](https://CRAN.R-project.org/package=vote) and [votesys](https://CRAN.R-project.org/package=votesys) R packages.
For strictly ABC-voting rules, see [abcvoting](https://github.com/martinlackner/abcvoting) Python package.
---
## Code of Conduct
Please note that the `fastVoteR` project is released with a [Contributor Code of Conduct](https://bblodfon.github.io/fastVoteR/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.