visHexGrid: Function to visualise a supra-hexagonal grid

Description Usage Arguments Value Note See Also Examples

View source: R/visHexGrid.r

Description

visHexGrid is supposed to visualise a supra-hexagonal grid

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
visHexGrid(
hbin,
area.size = 1,
border.color = NULL,
fill.color = NULL,
lty = 1,
lwd = 1,
lineend = "round",
linejoin = "round"
)

Arguments

hbin

an object of class "hexbin"

area.size

an inteter or a vector specifying the area size of each hexagon

border.color

the border color for each hexagon

fill.color

the filled color for each hexagon

lty

the line type for each hexagon. 0 for 'blank', 1 for 'solid', 2 for 'dashed', 3 for 'dotted', 4 for 'dotdash', 5 for 'longdash', 6 for 'twodash'

lwd

the line width for each hexagon

lineend

the line end style for each hexagon. It can be one of 'round', 'butt' and 'square'

linejoin

the line join style for each hexagon. It can be one of 'round', 'mitre' and 'bevel'

Value

invisible

Note

none

See Also

visHexComp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 1) generate an iid normal random matrix of 100x10 
data <- matrix( rnorm(100*10,mean=0,sd=1), nrow=100, ncol=10)
colnames(data) <- paste(rep('S',10), seq(1:10), sep="")

# 2) sMap resulted from using by default setup
sMap <- sPipeline(data=data)

# 3) create an object of "hexbin" class from sMap
dat <- data.frame(sMap$coord)
xdim <- sMap$xdim
ydim <- sMap$ydim
hbin <- hexbin::hexbin(dat$x, dat$y, xbins=xdim-1,
shape=sqrt(0.75)*ydim/xdim)

# 4) visualise hbin object
vp <- hexbin::hexViewport(hbin)
visHexGrid(hbin)

Example output

Loading required package: hexbin
Start at 2019-08-06 16:31:08

First, define topology of a map grid (2019-08-06 16:31:08)...
Second, initialise the codebook matrix (61 X 10) using 'linear' initialisation, given a topology and input data (2019-08-06 16:31:08)...
Third, get training at the rough stage (2019-08-06 16:31:08)...
	1 out of 7 (2019-08-06 16:31:08)
	updated (2019-08-06 16:31:08)
	2 out of 7 (2019-08-06 16:31:08)
	updated (2019-08-06 16:31:08)
	3 out of 7 (2019-08-06 16:31:08)
	updated (2019-08-06 16:31:08)
	4 out of 7 (2019-08-06 16:31:08)
	updated (2019-08-06 16:31:08)
	5 out of 7 (2019-08-06 16:31:08)
	updated (2019-08-06 16:31:08)
	6 out of 7 (2019-08-06 16:31:08)
	updated (2019-08-06 16:31:08)
	7 out of 7 (2019-08-06 16:31:08)
	updated (2019-08-06 16:31:08)
Fourth, get training at the finetune stage (2019-08-06 16:31:08)...
	1 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	2 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	3 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	4 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	5 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	6 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	7 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	8 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	9 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	10 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	11 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	12 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	13 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	14 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	15 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	16 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	17 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	18 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	19 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	20 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	21 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	22 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	23 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	24 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
	25 out of 25 (2019-08-06 16:31:09)
	updated (2019-08-06 16:31:09)
Next, identify the best-matching hexagon/rectangle for the input data (2019-08-06 16:31:09)...
Finally, append the response data (hits and mqe) into the sMap object (2019-08-06 16:31:09)...

Below are the summaries of the training results:
   dimension of input data: 100x10
   xy-dimension of map grid: xdim=9, ydim=9, r=5
   grid lattice: hexa
   grid shape: suprahex
   dimension of grid coord: 61x2
   initialisation method: linear
   dimension of codebook matrix: 61x10
   mean quantization error: 4.46310602774253

Below are the details of trainology:
   training algorithm: batch
   alpha type: invert
   training neighborhood kernel: gaussian
   trainlength (x input data length): 7 at rough stage; 25 at finetune stage
   radius (at rough stage): from 3 to 1
   radius (at finetune stage): from 1 to 1

End at 2019-08-06 16:31:09
Runtime in total is: 1 secs

supraHex documentation built on Nov. 26, 2020, 2:01 a.m.