elec88 {ade4}R Documentation

Electoral Data

Description

This data set gives the results of the presidential election in France in 1988 for each department and all the candidates.

Usage

data(elec88)

Format

elec88 is a list of 7 components.

tab
is a data frame with 94 rows (departments) and 9 variables (candidates)
res
is the global result of the election all-over the country.
lab
is a data frame with three variables: elec88$lab$dep a vector containing the names of the 94 french departments, elec88$lab$reg a vector containing the names of the 21 French administraitve regions. and, elec88$lab$reg.fac a factor with 21 levels defining the French administraitve regions.
area
is the data frame of 3 variables returning the boundary lines of each department. The first variable is a factor. The levels of this one are the row.names of tab. The second and third variables return the coordinates (x,y) of the points of the boundary line.
contour
is a data frame with 4 variables (x1,y1,x2,y2)for the contour display of France
xy
is a data frame with two variables (x,y) giving the position of the center for each department
neig
is the neighbouring graph between departments, object of the class neig

Source

Public data

See Also

This dataset is compatible with presid2002 and cnc2003

Examples

data(elec88)
apply(elec88$tab, 2, mean)
summary(elec88$res)

par(mfrow = c(2,2))
plot(elec88$area[,2:3], type = "n", asp = 1)
lpoly <- split(elec88$area[,2:3], elec88$area[,1])
lapply(lpoly, function(x) {points (x,type = "l");invisible()})
polygon(elec88$area[elec88$area$V1=="D25", 2:3], col = 1)
area.plot(elec88$area, graph = elec88$neig, lwdg = 1)
polygon(elec88$area[elec88$area$V1=="D25", 2:3], col = 1)
pca1 <- dudi.pca(elec88$tab, scal = FALSE, scan = FALSE)
area.plot(elec88$area, val = elec88$xy[,1] + elec88$xy[,2])
area.plot(elec88$area, val = pca1$li[,1], sub = "F1 PCA", 
    csub = 2, cleg = 1.5)
par(mfrow = c(1,1))

Worked out examples


> library(ade4)
> ### Name: elec88
> ### Title: Electoral Data
> ### Aliases: elec88
> ### Keywords: datasets
> 
> ### ** Examples
> 
> data(elec88)
> apply(elec88$tab, 2, mean)
 Mitterand     Chirac      Barre     Le.Pen   Lajoinie   Waechter     Juquin 
34.3063830 20.2670213 16.4680851 13.7606383  6.7106383  3.8638298  2.1670213 
Laguillier    Boussel 
 2.0574468  0.3989362 
> summary(elec88$res)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.40    2.10    6.80   11.11   16.50   34.10 
> 
> par(mfrow = c(2,2))
> plot(elec88$area[,2:3], type = "n", asp = 1)
> lpoly <- split(elec88$area[,2:3], elec88$area[,1])
> lapply(lpoly, function(x) {points (x,type = "l");invisible()})
$D1
NULL

$D10
NULL

$D11
NULL

$D12
NULL

$D13
NULL

$D14
NULL

$D15
NULL

$D16
NULL

$D17
NULL

$D18
NULL

$D19
NULL

$D2
NULL

$D21
NULL

$D22
NULL

$D23
NULL

$D24
NULL

$D25
NULL

$D26
NULL

$D27
NULL

$D28
NULL

$D29
NULL

$D3
NULL

$D30
NULL

$D31
NULL

$D32
NULL

$D33
NULL

$D34
NULL

$D35
NULL

$D36
NULL

$D37
NULL

$D38
NULL

$D39
NULL

$D4
NULL

$D40
NULL

$D41
NULL

$D42
NULL

$D43
NULL

$D44
NULL

$D45
NULL

$D46
NULL

$D47
NULL

$D48
NULL

$D49
NULL

$D5
NULL

$D50
NULL

$D51
NULL

$D52
NULL

$D53
NULL

$D54
NULL

$D55
NULL

$D56
NULL

$D57
NULL

$D58
NULL

$D59
NULL

$D6
NULL

$D60
NULL

$D61
NULL

$D62
NULL

$D63
NULL

$D64
NULL

$D65
NULL

$D66
NULL

$D67
NULL

$D68
NULL

$D69
NULL

$D7
NULL

$D70
NULL

$D71
NULL

$D72
NULL

$D73
NULL

$D74
NULL

$D75
NULL

$D76
NULL

$D77
NULL

$D78
NULL

$D79
NULL

$D8
NULL

$D80
NULL

$D81
NULL

$D82
NULL

$D83
NULL

$D84
NULL

$D85
NULL

$D86
NULL

$D87
NULL

$D88
NULL

$D89
NULL

$D9
NULL

$D90
NULL

$D91
NULL

$D92
NULL

$D93
NULL

$D94
NULL

$D95
NULL

> polygon(elec88$area[elec88$area$V1=="D25", 2:3], col = 1)
> area.plot(elec88$area, graph = elec88$neig, lwdg = 1)
> polygon(elec88$area[elec88$area$V1=="D25", 2:3], col = 1)
> pca1 <- dudi.pca(elec88$tab, scal = FALSE, scan = FALSE)
> area.plot(elec88$area, val = elec88$xy[,1] + elec88$xy[,2])
> area.plot(elec88$area, val = pca1$li[,1], sub = "F1 PCA", 
+     csub = 2, cleg = 1.5)
> par(mfrow = c(1,1))
> 
> 
> 

[Package ade4 Index]