Create a tuimap
htmlwidget
tuimap( shape = NULL, code = NULL, label = NULL, data = NULL, options = NULL, width = NULL, height = NULL, elementId = NULL )
shape | An |
---|---|
code | Variable to use as unique identifier for the polygons. |
label | Variable to use as label for the polygons. |
data | A |
options | A |
width | A numeric input in pixels. |
height | A numeric input in pixels. |
elementId | Use an explicit element ID for the widget. |
A tuichart
htmlwidget
object.
library(rnaturalearth) # Retrieve polygons sa <- ne_countries(continent = "south america", returnclass = "sf") # add a random numeric variable sa$random <- sample(1:100, nrow(sa), TRUE) # draw map tuimap() %>% add_map_data(sa, aes(code = adm0_a3, label = name, value = random)) %>% tui_chart(title = "A map")#>#>#> #>