hvtHmap: Heat Map over Hierarchical Voronoi Tessellations

hvtHmapR Documentation

Heat Map over Hierarchical Voronoi Tessellations

Description

Main function to construct heatmap overlay for hierarchical voronoi tessellations.

Usage

hvtHmap(
  hvt.results,
  dataset,
  child.level,
  hmap.cols,
  color.vec = NULL,
  line.width = NULL,
  centroid.size = 3,
  pch = 21,
  palette.color = 6,
  previous_level_heatmap = T,
  show.points = F,
  asp = 1,
  ask = T,
  tess.label = NULL,
  quant.error.hmap = NULL,
  n_cells.hmap = NULL,
  label.size = 0.5,
  ...
)

Arguments

hvt.results

List. A list of hvt.results obtained from the HVT function.

dataset

Data frame. The input data set.

child.level

Numeric. Indicating the level for which the heat map is to be plotted.

hmap.cols

Numeric or Character. The column number of column name from the dataset indicating the variables for which the heat map is to be plotted.

color.vec

Vector. A color vector such that length(color.vec) = (child.level - 1). (default = NULL)

line.width

Vector. A line width vector such that length(line.width) = (child.level - 1). (default = NULL)

centroid.size

Numeric. Indicating the centroid size of the first level. (default = 3)

pch

Numeric. Indicating the centroid's symbol type. (default = 21)

palette.color

Numeric. Indicating the heat map color palette. 1 - rainbow, 2 - heat.colors, 3 - terrain.colors, 4 - topo.colors, 5 - cm.colors, 6 - seas color. (default = 6)

previous_level_heatmap

Logical. If TRUE, the heatmap of previous level will be overlayed on the heatmap of selected level. If #' FALSE, the heatmap of only selected level will be plotted

show.points

Logical. Indicating if the centroids should be plotted on the tessellations. (default = FALSE)

asp

Numeric. Indicating the aspect ratio type. For flexible aspect ratio set, asp = NA. (default = 1)

ask

Logical. If TRUE (and the R session is interactive) the user is asked for input, before a new figure is drawn. (default = TRUE)

tess.label

Vector. A vector for labelling the tessellations. (default = NULL)

quant.error.hmap

Numeric. A number indicating the quantization error threshold.

n_cells.hmap

Numeric. An integer indicating the number of cells/clusters per hierarchy (level)

label.size

Numeric. The size by which the tessellation labels should be scaled. (default = 0.5)

...

The ellipsis is passed to it as additional argument. (Used internally)

Details

The output of the HVT function has all the required information about the HVT. Now a heat map is overlayed over this HVT. The user defines the level and also those variables of the data for which the heat map is to be plotted. Now for each variable a separate heat map is plotted. The plot area is divided into 2 screens where the first screen is relatively large and will have the heat map. The second screen is small and contains the gradient scale. To plot the heat map, the data is first normalized. The gradient scale is divided into 'n' regions(500 is the set default). Using the normalized data, the different regions into which the data items fall are found. Each data item is now having a region on the gradient scale. This color is filled in the tile corresponding to the data item. This procedure is done for all the tiles for that level to get the complete heat map. Once the heat map is ready, the higher level tessellations are plotted to represent the hierarchies. The size of the centroids, the thickness of the lines and the color of the tessellation lines can be given as input by the user. Appropriate values for these parameters should be given to identify the hierarchies properly. In the second screen the gradient scale is plotted. The heat maps and hierarchical tessellations are obtained for all the desired variables.

Author(s)

Shubhra Prakash <shubhra.prakash@mu-sigma.com>, Sangeet Moy Das <sangeet.das@mu-sigma.com>

See Also

plotHVT

Examples

data(USArrests)
hvt.results <- list()
hvt.results <- HVT(USArrests, n_cells = 15, depth = 1, quant.err = 0.2, 
                   distance_metric = "L1_Norm", error_metric = "mean",
                   projection.scale = 10, normalize = TRUE,
                   quant_method="kmeans",diagnose=TRUE)
hvtHmap(hvt.results, USArrests, child.level = 1,hmap.cols = 'Murder', 
        line.width = c(0.2), color.vec = c('#141B41'),palette.color = 6,
        quant.error.hmap = 0.2, n_cells.hmap = 6)

muHVT documentation built on March 7, 2023, 6:38 p.m.