Description Usage Arguments Value Examples
Create a tuimap
htmlwidget
1 2 3 4 5 6 7 8 9 10 |
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.
1 2 3 4 5 6 7 8 9 10 11 | 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.