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-10-29 03:46:19 UTC |
Source: | https://github.com/co-analysis/deckhand |
A vector of Cabinet Office's corporate palette
co_colours
co_colours
An object of class character
of length 11.
CO data reports
co_deck(css = NULL, ...)
co_deck(css = NULL, ...)
css |
Additional css files (default is |
... |
Arguments to pass on to |
A simple function to return the embedded logo, either as an html element or the file path to the image.
co_logo(out = c("html", "path"))
co_logo(out = c("html", "path"))
out |
Either |
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.
export_plot(gg_plot, filename, width, height)
export_plot(gg_plot, filename, width, height)
gg_plot |
The ggplot to render |
filename |
The file to export |
width |
The width in report columns |
height |
The height in report columns |
A function to convert a ggplot object to an SVG image for rendering in the deckhand column/row grid structure
insert_svg(gg_plot, width, height)
insert_svg(gg_plot, width, height)
gg_plot |
The ggplot to convert |
width |
The width of the plot, in page columns |
height |
The height of the plot, in page columns |
Take an table constructed via the gt package and format it so that it will work with the pagedown report template and css files.
output_table( x, id = NULL, min_max_styling = FALSE, drop_header = FALSE, small = FALSE )
output_table( x, id = NULL, min_max_styling = FALSE, drop_header = FALSE, small = FALSE )
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 |
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).
scale_colour_co(..., colour, direction = 1, show.na = FALSE) scale_fill_co(..., fill, direction = 1, show.na = FALSE)
scale_colour_co(..., colour, direction = 1, show.na = FALSE) scale_fill_co(..., fill, direction = 1, show.na = FALSE)
... |
Other arguments passed to discrete scale |
colour |
A colour name from |
direction |
The direction of the scale |
show.na |
Whether to show NA values |
fill |
A colour name from |
A function to show the CO colour palette
show_co_colours()
show_co_colours()
View the example report
show_example_report(type = c("html", "pdf"), location = c("web", "local"))
show_example_report(type = c("html", "pdf"), location = c("web", "local"))
type |
Either |
location |
Either |
## Not run: show_example_report() ## End(Not run)
## Not run: show_example_report() ## End(Not run)
Provide common styling to ggplot objects
theme_co_report( base = "minimal", legend_position = "top", legend_title = "none", axis_text = "both", axis_title = "none" )
theme_co_report( base = "minimal", legend_position = "top", legend_title = "none", axis_text = "both", axis_title = "none" )
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) |
A function to produce a tinted version of a hexadecimal colour code
tint_hex(colour, tint, bg_colour = "#ffffff")
tint_hex(colour, tint, bg_colour = "#ffffff")
colour |
The colour to tint |
tint |
The percentage tint desired, higher is 'lighter' |
bg_colour |
The background colour to tint against, defaults to white |