Skip to contents

Creates a dashboard automation script and writes it to crunch/{name}.

Usage

crunch_generate_dashboard(
  crunch_dashboard_spec,
  name = "Dashboard",
  filters = NULL,
  overwrite = FALSE,
  open = rlang::is_interactive()
)

Arguments

crunch_dashboard_spec

A tibble with folder and tile_code.

name

Dashboard name. Defaults to "Dashboard".

filters

Optional character vector of filter aliases.

overwrite

Logical. Overwrite existing file if different.

open

Logical. Open the generated file when interactive.

Examples

if (FALSE) { # \dontrun{
crunch_dictionary <- crunch_get_dictionary()
crunch_dashboard_spec <- crunch_dictionary |>
  filter(!is.na(folder)) |>
  rowwise() |>
  mutate(
    tile_code = as.character(crunch_generate_tile(
      .data$alias, .data$name, .data$type, .data$description
    ))
  ) |>
  ungroup() |>
  select(folder, tile_code)

crunch_generate_dashboard(crunch_dashboard_spec, name = "Dashboard")
runCrunchAutomation(crunch_connect(), readr::read_lines("crunch/Dashboard"))
} # }