sebastianbarfort / mapDK

R package for making maps of Denmark
49 stars 5 forks source link

Bug: Setting "show_missing=FALSE" messes stuff up #11

Closed AndersMunkN closed 8 years ago

AndersMunkN commented 9 years ago

When the option "show_missing=FALSE" is given, the coloring appears completely random. The following produces two maps that should be identical but are not;

crime <- mapDK::crime # load crime data mapDK(values = "indbrud",id="kommune",data=crime,show_missing=FALSE) crime2 <- crime[order(crime$kommune),] mapDK(values = "indbrud",id="kommune",data=crime2,show_missing=FALSE)

When the option is removed, the maps become correct.

My guess is that the bug has to do with using the ID or something because sorting the data changes the coloring.