esaps_object: Create an object of class esaps

Description Usage Arguments Examples

Description

Create an object of esaps class to calculate party system indicators.

Usage

1
2
3
esaps_object(path = NULL, dataset = NULL, name.file = NULL,
  extention = NULL, nCountry = NULL, name.year, name.country,
  name.M = NULL)

Arguments

path

Character vector containing one or more path names.

dataset

Electoral results by party. It can be a matrix, a data.frame or a list.

name.file

Name of the database file.

extention

Extension of the database format.

nCountry

Number of countries (number of sheets).

name.year

Name of the variable that contains years.

name.country

Name of the variable that contains the country.

name.M

Name of the variable that contains the district magnitude (M+1). It is for the calculation of endogenous and exogenous electoral volatility (Torcal and Lago, 2015).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
votes <- list(data.frame(country = rep("ARG", 3),
                         year = c(1995, 2000, 2005),
                         party_A = c(40,10,20),
                         party_B = c(35,20,40),
                         party_C = c(25,70,40)),
              data.frame(country = rep("URY", 4),
                         year = c(1995, 2000, 2005, 2010),
                         party_A = c(30,30,20,20),
                         party_B = c(30,50,40, 30),
                         party_C = c(30,10,30, 25),
                         party_D = c(10,10,10,25)),
              data.frame(country = rep("BRA", 2),
                         year = c(1993, 1998),
                         party_A = c(30, 55),
                         party_B = c(70, 45)))

votes <- esaps_object(dataset=votes, name.country="country", name.year="year")
is(votes, "esaps")    ## TRUE

Nicolas-Schmidt/old_esaps documentation built on May 17, 2019, 3:13 a.m.