Skip to content

One of my maps has 5 colors #2

@ghost

Description

Hi,
First off, thanks for the great work. This was just what I wanted.

Working with a map, I noticed that I got 5 colors. Is this a bug or some sort of freak occurrence.

My code:

library("rgdal")
library("raster")
library("MapColoring")

districts <- readRDS("IND_adm2.rds") #Downloaded from http://gadm.org  ->India, level 2
colors <- getColoring(districts)
cand.colors <- rainbow(20)
opt.colors <- getOptimalContrast(x=districts, col=cand.colors)
par(mar=c(0,0,0,0))

Printing out colors, I see that colors[265] and colors[270] for eg, have the value 5.
Cheers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions