tri_alloc {DHBins} | R Documentation |
Allocate triangles within hexagons
Description
This implements the Webster/Sainte-Laguë method to allocate six triangles in each hexagon, in proportion to counts in two or more classes.
Usage
tri_alloc(countmatrix, colours, classes=colours, names = rownames(countmatrix))
Arguments
countmatrix |
A matrix of counts with a column for each class and a row for each hexagon. |
colours , classes |
A vector of class names, or colour names with one for each class |
names |
A vector of names, for each row of |
Value
Matrix of class names, with six columns. The rownames will be set to names
if provided.
Examples
data(dhb_cars)
tri_alloc(dhb_cars[,-1], c("green","gold","orange","goldenrod"), names=dhb_cars$dhb )
tri_alloc(dhb_cars[,-1], c("0","1","2","3+"), names=dhb_cars$dhb )
[Package DHBins version 1.1 Index]