Package 'deckhand'

Title: Create data heavy {pagedown} reports (slide decks)
Description: Generate {pagedown} reports for data heavy publications. Often these types of reports have been laid out using presentation software and therefore called "slide decks" even though they aren't presented but turned into PDFs and printed. A deckhand is an experienced seaman in the merchant navy who helps with the general running of a ship, the {deckhand} package helps you produce your report.
Authors: Crown Copyright [cph, fnd], Matt Kerlogue [aut, cre]
Maintainer: The package maintainer <[email protected]>
License: MIT + file LICENSE
Version: 0.0.9
Built: 2024-09-29 04:03:52 UTC
Source: https://github.com/co-analysis/deckhand

Help Index


Vector of CO colours

Description

A vector of Cabinet Office's corporate palette

Usage

co_colours

Format

An object of class character of length 11.


CO data reports

Description

CO data reports

Usage

co_deck(css = NULL, ...)

Arguments

css

Additional css files (default is NULL)

...

Arguments to pass on to pagedown::html_paged()


Export report plot as PNG

Description

Export report plots with a sizing similar to that of the plot created by insert_svg(). Plots are exported as SVG if the file extension is .svg otherwise they are exported in PNG format.

Usage

export_plot(gg_plot, filename, width, height)

Arguments

gg_plot

The ggplot to render

filename

The file to export

width

The width in report columns

height

The height in report columns


Insert plot as SVG

Description

A function to convert a ggplot object to an SVG image for rendering in the deckhand column/row grid structure

Usage

insert_svg(gg_plot, width, height)

Arguments

gg_plot

The ggplot to convert

width

The width of the plot, in page columns

height

The height of the plot, in page columns


Export a gt pipeline into output format

Description

Take an table constructed via the gt package and format it so that it will work with the pagedown report template and css files.

Usage

output_table(
  x,
  id = NULL,
  min_max_styling = FALSE,
  drop_header = FALSE,
  small = FALSE
)

Arguments

x

The gt table

id

A unique id for the table

min_max_styling

Convert min/max flags to css classes

drop_header

Drop the table header row(s)

small

Whether to render in a smaller font


Use CO colours for colour scales

Description

The scale_*_co() functions provide a way to easily apply a colour from the CO corporate palette to a chart, the take a single colour name and apply tints of that colour to the relevant series (colour/fill).

Usage

scale_colour_co(..., colour, direction = 1, show.na = FALSE)

scale_fill_co(..., fill, direction = 1, show.na = FALSE)

Arguments

...

Other arguments passed to discrete scale

colour

A colour name from co_colours() for scale_colour_co()

direction

The direction of the scale

show.na

Whether to show NA values

fill

A colour name from co_colours() for scale_fill_co()


Show palette colours

Description

A function to show the CO colour palette

Usage

show_co_colours()

Open example report in the browser

Description

View the example report

Usage

show_example_report(type = c("html", "pdf"), location = c("web", "local"))

Arguments

type

Either html (the default) or pdf

location

Either web (the default) or local

Examples

## Not run: 
show_example_report()

## End(Not run)

Report plot theme

Description

Provide common styling to ggplot objects

Usage

theme_co_report(
  base = "minimal",
  legend_position = "top",
  legend_title = "none",
  axis_text = "both",
  axis_title = "none"
)

Arguments

base

The base ggplot theme (either minimal or void)

legend_position

The location of the plot legend

legend_title

The title for the legend or "none" (the default) for no title

axis_text

Which axis to include text for: "both" (the default), "x", "y" or "none"

axis_title

Which axis to include titles for: "both", "x", "y" or "none" (the default)


Produce tints of hex colours

Description

A function to produce a tinted version of a hexadecimal colour code

Usage

tint_hex(colour, tint, bg_colour = "#ffffff")

Arguments

colour

The colour to tint

tint

The percentage tint desired, higher is 'lighter'

bg_colour

The background colour to tint against, defaults to white