Skip to content

ordered = TRUE makes more sense for colorFactor #800

Open
@bogaotory

Description

@bogaotory

colorFactor <- function(palette, domain, levels = NULL, ordered = FALSE,

I was a bit confused when running the last code block (under the title "Circle Markers") of the example given at https://rstudio.github.io/leaflet/markers.html

When the code is written as pal <- colorFactor(c("navy", "red"), domain = c("ship", "pirate")), then it is highly likely that the user's intention is to have navy for ship, and red for pirate.
Therefore it makes more sense that colorFactor should assume that the domain vector is already ordered (ordered = TRUE) unless stated otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions