library(remotes)
library(circlepackeR)
library(data.tree)
library(treemap)
library(readxl)
library(jsonlite)
library(tidyverse)
## -- Attaching packages ------------------------------------------------------------------------------------------------------------------------------------------------------------- tidyverse 1.2.1 --
## v ggplot2 3.1.0     v purrr   0.2.5
## v tibble  2.0.1     v dplyr   0.7.8
## v tidyr   0.8.2     v stringr 1.3.1
## v readr   1.3.1     v forcats 0.3.0
## -- Conflicts ---------------------------------------------------------------------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter()  masks stats::filter()
## x purrr::flatten() masks jsonlite::flatten()
## x dplyr::lag()     masks stats::lag()
library(treemap)
library(sunburstR)
library(networkD3)
library(htmlwidgets)
## 
## Attaching package: 'htmlwidgets'
## The following object is masked from 'package:networkD3':
## 
##     JS
# stupid broken code -- removes entire row's with NA
df <- read_xlsx("trainbook_80perc.xlsx", sheet = "Table") %>%
  na.omit()

# Reformat data for the sunburstR package
df <- df %>%
  mutate(path = paste(group_title, area_subtype, area_subtype2, sep = "-")) %>%
  dplyr::select(path, value)

# Plot
sunburst(df, legend=FALSE)
Legend
# stupid code includes NA's
df <- read_xlsx("trainbook_80perc.xlsx", sheet = "Table")

# Reformat data for the sunburstR package
df <- df %>%
  mutate(path = paste(group_title, area_subtype, area_subtype2, sep = "-")) %>%
  dplyr::select(path, value)

# Plot
sunburst(df, legend=FALSE)
Legend