Skip to content
📊 R htmlwidget for tui-chart
R JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
docs
inst/htmlwidgets
man
vignettes
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
LICENSE
NAMESPACE
README.md
_pkgdown.yml

README.md

tuichartr

Htmlwidget to create interactive visualisations with JavaScript library tui-chart

Travis build status Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Lifecycle: experimental

Installation

You can install from GitHub with:

remotes::install_github("dreamRs/tuichartr")

Charts

You can create various type of chart : bar, column, line, area, boxplot, scatter, heatmap, treemap, radar, pie.

library(gapminder)
library(tuichartr)

# Datas
n_countries <- gapminder %>% 
  filter(year == 2007) %>% 
  count(continent, sort = TRUE)

# Chart
tuichart("bar") %>% 
  add_data(n_countries, aes(x = continent, y = n)) %>% 
  tui_chart(title = "Countries by continent in 2007") %>% 
  tui_xAxis(title = "Number of countries") %>% 
  tui_legend(visible = FALSE) %>% 
  tui_series(showLabel = TRUE)

Maps

You can also make maps :

# Retrieve Italy polygons
uk <- ne_states("united kingdom", returnclass = "sf")
# add a random numeric variable
uk$random <- sample(1:100, nrow(uk), TRUE)

# draw map
tuimap() %>% 
  add_map_data(uk, aes(code = adm1_code, label = name, value = random)) %>% 
  tui_chart(title = "UK map")

You can’t perform that action at this time.