tuimap: Create a 'tuimap' htmlwidget

Description Usage Arguments Value Examples

View source: R/tuimaps.R

Description

Create a tuimap htmlwidget

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tuimap(
  shape = NULL,
  code = NULL,
  label = NULL,
  data = NULL,
  options = NULL,
  width = NULL,
  height = NULL,
  elementId = NULL
)

Arguments

shape

An sf object.

code

Variable to use as unique identifier for the polygons.

label

Variable to use as label for the polygons.

data

A list of parameters for the data used in the chart.

options

A list of options for the chart.

width

A numeric input in pixels.

height

A numeric input in pixels.

elementId

Use an explicit element ID for the widget.

Value

A tuichart htmlwidget object.

Examples

 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")

dreamRs/tuichartr documentation built on Aug. 8, 2020, 9:58 a.m.