plotResult: plots result of the voter transition table

Description Usage Arguments See Also Examples

Description

plots results of the voter transition table. Supports absolute values, relative values and negative values

Usage

1
2
3
plotResult(x, abs = FALSE, bgColors = c("white", "steelblue", 10),
  rectOpts = list(border = grey(0.7)), cellOpts = list(cex = 1),
  dimNameOpts = list(col = grey(0.2), cex = 0.8))

Arguments

x

matrix with results

abs

TRUE if values are not between [0,1] (Default is FALSE)

bgColors

vector with 3 elements: starting colour of new colour palette, ending colour of new colour palette, length of colour palette

rectOpts

named list of options for rectangle

cellOpts

named list of options for inner cell text

dimNameOpts

named list of options for dimnames

See Also

getBalance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
# loading some fake election data
data(topleveldat)
form <- cbind(CSU_2, SPD_2, LINK_2, GRUN_2) ~ cbind(CSU_1, SPD_1, Link_1)
set.seed(1234)
res <- indAggEi(form=form, aggr=aggr, indi=indi, IDCols=c("ID","ID"),
                  sample=1000, thinning=2, burnin=100,verbose=100)
res2 <- indAggEi(form=form, aggr=aggr, indi=indi, IDCols=c("ID","ID"),
                 sample=1000, thinning=2, burnin=100,verbose=100)


tabs <- summary(res)
tabs2 <- summary(res2)
plotResult(round(tabs$relative,3))
plotResult(tabs$absolut, abs=TRUE)
bal <- getBalance(tabs$absolut, which=c("c","GRUN_2"))
plotResult(bal, abs=TRUE)

plotResult(round(tabs$relative,3), bgColors=c("white", "darkorange", 9))
plotResult(round(tabs$relative,3), bgColors=c("white", "darkorange", 5))

plotResult(round(tabs$relative,3) - round(tabs2$relative, 3), abs=TRUE,
           bgColors=c("white", "darkorange", 9))

# ugly ;)
plotResult(round(tabs$relative,3), bgColors=c("blue", "red", 5))
#' 
## End(Not run)

eiwild documentation built on May 2, 2019, 6:31 p.m.

Related to plotResult in eiwild...