make_table: Create a table for the dashboard or a briefing document

View source: R/make_table.R

make_tableR Documentation

Create a table for the dashboard or a briefing document

Description

Create a table for the dashboard or a briefing document

Usage

make_table(
  data,
  destination = Sys.getenv("R_DJPRLABOURDASH_TABLEDEST", unset = "dashboard"),
  years_in_sparklines = 3,
  row_order = NULL,
  highlight_rows = NULL,
  notes = NULL,
  title = "",
  rename_indicators = TRUE,
  pretty_round = TRUE
)

Arguments

data

A data frame containing data to summarise

destination

"dashboard", "briefing" or "ppqs

years_in_sparklines

Period of time to include in the sparkline line charts.

row_order

Vector of series IDs, in the order in which you wish the corresponding rows to be included in the output table

highlight_rows

Vector of series IDs, corresponding to rows in the table to highlight. Highlighted rows are bolded and have a top border; non-highlighted rows are indented. If NULL then all rows are non-bold, non-indented.

notes

Optional notes to add to caption. Source will be inferred automatically based on the data using caption_auto().

title

Character vector to use as the table title. Will only be used when destination is "briefing".

rename_indicators

logical; default is TRUE. If TRUE, the rename_indicators() function will be used to rename certain indicators.

pretty_round

Logical; TRUE by default. If TRUE, figures will be rounded using pretty_round(). This means (for eg.) figures below 50 will be rounded to 0. If FALSE, figures will not be rounded with pretty_round().

Examples

# dash_data <- load_dash_data()
## Not run: 
make_table(
  data = filter_dash_data(series_ids = c(
    "A84423354L",
    "A84423242V",
    "A84423466F"
  )),
  row_order = c(
    "A84423354L",
    "A84423242V",
    "A84423466F"
  ),
  highlight_rows = c("A84426256L")
)

## End(Not run)

djpr-data/djprlabourdash documentation built on April 28, 2023, 6:16 p.m.