powered by
Creates a mapdeck legend element for when you want to manually specify a legend (using mapdeck_legend)
legend_element( variables, colours, colour_type = c("fill", "stroke"), variable_type = c("category", "gradient"), title = "", css = "" )
variables assigned to colours
vector of hex colours assigned to variables
one of "fill" or "stroke"
one of category (discrete) or gradient (continuous)
string used as the legend title
string of css to control appearance.
mapdeck_legend
l1 <- legend_element( variables = c("a","b") , colours = c("#00FF00","#FF0000") , colour_type = "fill" , variable_type = "category" , title = "my title" )
Run the code above in your browser using DataLab