plot.choicealpha: Plot to choose the mixing parameter

Description Usage Arguments References See Also Examples

View source: R/plot.choicealpha.R

Description

Plot two curves of explained inertia (one for D0 and one for D1) calculated with choicealpha.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S3 method for class 'choicealpha'
plot(
  x,
  norm = FALSE,
  lty = 1:2,
  pch = c(8, 16),
  type = c("b", "b"),
  col = 1:2,
  xlab = "alpha",
  ylab = NULL,
  legend = NULL,
  cex = 1,
  ...
)

Arguments

x

an object of class choicealpha.

norm

if TRUE, the normalized explained inertia are plotted. Otherwise, the explained inertia are plotted.

lty

a vector of size 2 with the line types of the two curves. See par

pch

a vector of size 2 specifying the symbol for the points of the two curves. See par

type

a vector of size 2 specifying the type of lines of the two curves. See par

col

a vector of size 2 specifying the colors the two curves. See par

xlab

the title fot the x axis.

ylab

the title fot the y axis.

legend

a vector of size two the the text for the legend of the two curves.

cex

text size in the legend.

...

further arguments passed to or from other methods.

References

M. Chavent, V. Kuentz-Simonet, A. Labenne, J. Saracco. ClustGeo: an R package for hierarchical clustering with spatial constraints. Comput Stat (2018) 33: 1799-1822.

See Also

choicealpha

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(estuary)
D0 <- dist(estuary$dat)
D1 <- as.dist(estuary$D.geo) # the geographic distances between the cities
range.alpha <- seq(0,1,0.1)
K <- 5
cr <- choicealpha(D0,D1,range.alpha,K,graph=FALSE)
plot(cr,cex=0.8,norm=FALSE,cex.lab=0.8,ylab="pev",
         col=3:4,legend=c("socio-demo","geo"), xlab="mixing parameter")
plot(cr,cex=0.8,norm=TRUE,cex.lab=0.8,ylab="pev",
         col=5:6,pch=5:6,legend=c("socio-demo","geo"), xlab="mixing parameter")
         

chavent/ClustGeo documentation built on Oct. 2, 2021, 3:55 a.m.