dashboard ex?

Column {data-width=600}

Sales Forecast

AirPassengers %>% 
  forecast(level = 90) %>% 
  hchart() %>% 
  hc_add_theme(thm)
## PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.
## Warning in normalizePath(f2): path[1]="webshot16db06df66790.png": No such file or directory
## Warning in file(con, "rb"): cannot open file 'webshot16db06df66790.png': No such file or directory
## Error in file(con, "rb"): cannot open the connection

Sales by State

data("USArrests", package = "datasets")
data("usgeojson")

USArrests <- USArrests %>%
  mutate(state = rownames(.))

n <- 4
colstops <- data.frame(
  q = 0:n/n,
  c = substring(viridis(n + 1), 0, 7)) %>%
  list.parse2()
## Error in list.parse2(.): could not find function "list.parse2"
highchart() %>%
  hc_add_series_map(usgeojson, USArrests, name = "Sales",
                    value = "Murder", joinBy = c("woename", "state"),
                    dataLabels = list(enabled = TRUE,
                                      format = '{point.properties.postalcode}')) %>%
  hc_colorAxis(stops = colstops) %>%
  hc_legend(valueDecimals = 0, valueSuffix = "%") %>%
  hc_mapNavigation(enabled = TRUE) %>%
  hc_add_theme(thm)
## Error in list.merge(hc$x$hc_opts[[name]], list(...)): object 'colstops' not found

Column {.tabset data-width=400}

Sales by Category

data("Groceries", package = "arules")
## Error in find.package(package, lib.loc, verbose = verbose): there is no package called 'arules'
dfitems <- tbl_df(Groceries@itemInfo)
## Error in as_tibble(data, .name_repair = "check_unique"): object 'Groceries' not found
set.seed(10)

dfitemsg <- dfitems %>%
  mutate(category = gsub(" ", "-", level1),
         subcategory = gsub(" ", "-", level2)) %>%
  group_by(category, subcategory) %>% 
  summarise(sales = n() ^ 3 ) %>% 
  ungroup() %>% 
  sample_n(31)
## Error in mutate(., category = gsub(" ", "-", level1), subcategory = gsub(" ", : object 'dfitems' not found
tm <- treemap(dfitemsg, index = c("category", "subcategory"),
              vSize = "sales", vColor = "sales",
              type = "value", palette = rev(viridis(6)))
## Error in treemap(dfitemsg, index = c("category", "subcategory"), vSize = "sales", : object 'dfitemsg' not found
highchart() %>% 
  hc_add_series_treemap(tm, allowDrillToNode = TRUE,
                        layoutAlgorithm = "squarified") %>% 
  hc_add_theme(thm)
## Error in hc_add_series_treemap(., tm, allowDrillToNode = TRUE, layoutAlgorithm = "squarified"): could not find function "hc_add_series_treemap"