Learn R Programming

SciencesPo (version 1.4.1)

A Tool Set for Analyzing Political Behavior Data

Description

Provide functions for analyzing elections and political behavior data, including measures of political fragmentation, seat apportionment, and small data visualization graphs.

Copy Link

Version

Install

install.packages('SciencesPo')

Monthly Downloads

139

Version

1.4.1

License

GPL (>= 2)

Last Published

August 4th, 2016

Functions in SciencesPo (1.4.1)

Condorcet

Condorcet Voting
CountMissing

Count missing data.
Clear

Clear Memory of All Objects
Calibrateplot

Calibrate Plot
scale_color_party

Political Parties Color Palette (Discrete) and Scales
Anonymize

To Make Anonymous a Data Frame
CrossValidation

Cross Validation of SciencesPo Trees and Forests
Atkinson

Atkinson Index of Inequality
Bootstrap

Method for Bootstrapping
Crosstable

Cross-tabulation
Footnote

Add Footnote to ggplot2 Objects
Forge

Veritical, left-aligned layout for plots
scale_fill_party

Political Parties Color Palette (Discrete) and Scales
ddirichlet

Dirichlet Distribution
Formatted

Some Formats for Nicer Display
Flag

Add an "id" Variable to a Dataset
Describe

Summary Description Table
freq

Simple Frequency Table
Dummify

Generate Dummy Variables in a Data Frame
dHondt

The D'Hondt Method of Allocating Seats Proportionally
Frequency

Frequency Table
GeomSpotlight

Automatically enclose points in a polygon
geom_lollipop

Lollipop charts
Gini

Gini Coefficient G
Hamilton

The Hamilton Method of Allocating Seats Proportionally
Herfindahl

Herfindahl Index of Concentration
geom_dumbbell

Dumbell charts
HighestAverages

Highest Averages Methods of Allocating Seats Proportionally
GiniSimpson

Gini-Simpson Index
Jackknife

Resamples Data Using the Jackknife Method
MakeShare

Clean up a character vector to make it a percent
MeanFromRange

Estimates Mean and Standard Deviation from Median and Range
Label

Get Variable Label
%nin%

Not in (Find Matching or Non-Matching Elements)
JamesStein

James-Stein Shrunken Estimates
Kurtosis

Compute the Kurtosis
Label<-

Set Variable Label
Lorenz

The Lorenz Curve
LargestRemainders

Largest Remainders Methods of Allocating Seats Proportionally
MakeNumeric

Clean up a character vector to make it numeric
party_pal

Political Parties Color Palette (Discrete) and Scales
Plotting

Plot Customizing
Permutate

Create k random permutations of a vector
Operations

Arithmetic and Statistiscal Functions but Dealing with Missing Data
print.SciencesPo

Print method for objects of class SciencesPo.
Outlier

Detect Outliers
Proportionality

Indexes of (Disproportionality) Proportionality
Palettes

Palette data for the themes used by package
scale_color_pub

Publication color scales.
scale_fill_pub

Publication color scales.
rdirichlet

Dirichlet Distribution
read.zTree

Reads zTree output files
SciencesPo

A Tool Set for Analyzing Political Behavior Data
SciencesPoFont

SciencesPo Base Fonts
summary.Crosstable

Print Crosstable style
theme_pub

The Default Theme
theme_fte

Themes for ggplot2 Graphs
Stratify

Stratified Sampling
WeightedCorrelation

Compute Weighted Correlations
WeightedMean

Computes Weighted Mean
Scatterplot

Quartile-Frame Scatterplot
SciencesPo-deprecated

Deprecated functions in package ‘SciencesPo’
Tableplot

Tableplot: a Visualization of Datasets
Waffleplot

Make waffle (square pie) charts
Voronoi

Voronoi tessellation diagram
Ternaryplot

Ternary Plot Build ternary plots.
pub_shapes

Shape scales for theme_pub (discrete)
pub_pal

Color Palettes for Publication (discrete)
Skewness

Compute the Skewness
scale_shape_pub

Shape scales for theme_pub (discrete)
TwoWay

Cross Tabulation
Untable

Untable an Aggregated Data Frame
Winsorize

Winsorized Mean
RunShinyApp

Examples from the SciencesPo Package
Rosenbluth

Rosenbluth Index of Concentration
Today

Print the current date in a pretty format
Transform

Functions for transformation of variables.
Recode

Recode or Replace Values With New Values
Render

Render layer on top of a ggplot
theme_blank

Create a Completely Empty Theme
theme_darkside

The Dark Side Theme
WeightedStdz

Computes Weighted Standardized Values
%>%

Then Operator
theme_scipo

The SciPo Theme
WeightedVariance

Weighted Variance