tri_alloc | R Documentation |
This implements the Webster/Sainte-Laguë method to allocate six triangles in each hexagon, in proportion to counts in two or more classes.
tri_alloc(countmatrix, colours, classes=colours, names = rownames(countmatrix))
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 |
Matrix of class names, with six columns. The rownames will be set to names
if provided.
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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.