Giter Site home page Giter Site logo

politicsr's Introduction

politicsR

CRAN_Status_Badge AppVeyor Build Status DOI

politicsR is an R package designed to help political science researchers in calculating conventional party system and political metrics. It offers a comprehensive set of functions for calculating a wide range of indicators, including:

  • Party System Fractionalization Index as proposed by Douglas Rae (1968)

  • Effective Number of Political Parties by Laakso, M., & Taagepera, R. (1979)

  • Party Nationalization Index by Jones, M. P., & Mainwaring, S. (2003)

  • Rice Party Cohesion Index by Rice (1925); and many more.

Installation

You can install the development version of politicsR from GitHub with:

# install.packages("devtools")
devtools::install_github("silvadenisson/politicsR")

Basic usage

To get started with politicsR, load the package with:

library(politicsR)
#> 
#> To cite politicsR in publications, use: citation('politicsR')

Then you can start calculating diffent metrics, such as the Herfindahl-Hirschman Concentration Index (HH):

x <- c(0.1, 0.1, 0.3, 0.5)
hh(x)
#> [1] 0.36

Or the Effective Number of Political Parties (ENP):

enp(x)
#> [1] 2.777778

The politicsR package also contains a few datasets with electoral results that can be used to test its functions. These datasets are organized by the Constituency-Level Elections Archive (CLEA) project and provide a rich source of information for political analysis. With these datasets and the functions provided by the package, users can easily calculate political science metrics such as Douglas Rae’s Fractionalization Index:

data(spain)
barc2019 <- spain[spain$yr == 2019 & spain$cst_n == "Barcelona",]
fractionalization(barc2019$pvs1)
#> [1] 0.6828265

politicsr's People

Contributors

silvadenisson avatar meirelesff avatar willbernascimento avatar jasjuniorj avatar

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.