library(leaflet)
previewColors(colorFactor("RdYlBu", domain = NULL), LETTERS[1:5])
library(htmltools)
browsable(
tagList(
previewColors(colorFactor("RdYlBu", domain = NULL), LETTERS[1:5]),
previewColors(colorFactor("RdYlBu", levels = rev(LETTERS[1:5])), LETTERS[1:5]),
previewColors(colorFactor("RdYlBu", levels = c("B","D","A","E","C")), LETTERS[1:5])
)
)
letter_cat <- LETTERS[round(runif(100,1,5))]
previewColors(colorFactor("RdYlBu", domain = NULL), letter_cat)
previewColors(colorFactor("RdYlBu", domain = letter_cat), letter_cat)
previewColors(
colorFactor(
"RdYlBu",
levels = sort(unique(letter_cat),decreasing=TRUE)
),
letter_cat
)
previewColors(
colorFactor(
"RdYlBu",
levels = c("B","D","A","E","C")
),
letter_cat
)