Title: | Default styles for EcoHealth Alliance Reports |
---|---|
Description: | Contains R Markdown templates and ggplot2 themes suitable for EHA work |
Authors: | Noam Ross [aut, cre], Emma Mendelsohn [aut], Collin Schwantes [aut], EcoHealth Alliance [cph] |
Maintainer: | Collin Schwantes <[email protected]> |
License: | MIT |
Version: | 0.1.1 |
Built: | 2024-10-24 04:13:56 UTC |
Source: | https://github.com/ecohealthalliance/ehastyle |
Opens markdown templates as rmd files and/or renders them into their appropriate format.
check_templates( style = c("classic", "avenir", "predict"), format = c("pptx", "xar", "flex"), aspect = c("4x3", "16x9"), check_all = FALSE, render = TRUE, outdir = "./", recursive = TRUE )
check_templates( style = c("classic", "avenir", "predict"), format = c("pptx", "xar", "flex"), aspect = c("4x3", "16x9"), check_all = FALSE, render = TRUE, outdir = "./", recursive = TRUE )
style |
String. One of "classic", "avenir", or "predict" |
format |
String. One of "pptx","xar", or"flex" |
aspect |
String. One of "4x3" or "16x9" |
check_all |
Logical. Should we open all the templates as RMDs? |
render |
Logical. Should we render the templates we open? |
outdir |
String. Where should files be stored |
recursive |
Logical. Should subfolders of outdir be created |
Styles for eha rmarkdown ppt. Used with a template to create presentations that dynamically update with your data.
eha_avenir_pptx( aspect = "16x9", master = "EcoHealth Alliance", toc = FALSE, toc_depth = 2, fig_width = 9.4, fig_height = 4.24, fig_caption = TRUE, df_print = "default", keep_md = FALSE, smart = TRUE, md_extensions = NULL, slide_level = NULL, pandoc_args = NULL )
eha_avenir_pptx( aspect = "16x9", master = "EcoHealth Alliance", toc = FALSE, toc_depth = 2, fig_width = 9.4, fig_height = 4.24, fig_caption = TRUE, df_print = "default", keep_md = FALSE, smart = TRUE, md_extensions = NULL, slide_level = NULL, pandoc_args = NULL )
aspect |
String. Aspect ratio for power point slides. Either "16x9" or "4x3". Default is "16x9" |
master |
String. Name of slide master for template ppt.
Use |
toc |
Logical. Should the slides have a table of contents? Default is FALSE |
toc_depth |
Numeric. How many levels should the table of contents have. Default is 2. |
fig_width |
Numeric. Width of figures. Default is 9.4 |
fig_height |
Numeric. Height of figures. Default is 4.24 |
fig_caption |
Logical. Should figures have captions? Default is TRUE |
df_print |
String. Print data frames? Default is "default" |
keep_md |
Logical. Should markdown document be kept? Default is FALSE |
smart |
Logical. Produce typographically correct outs. Default is TRUE |
md_extensions |
String. Additional markdown extensions. Default is NULL |
slide_level |
Numeric. Defines the heading level that defines individual slides. Default is NULL |
pandoc_args |
Arguments to pass to pandoc |
powerpoint_presentation
, rpptx_document
A function to produce an EHA Xaringan theme with the avenir font. This
function leans on style_mono_light
for many of
the theme arguments. It uses moon_reader
to create
the markdown renderable object. Unlike eha_classic_pptx
, you
cannot create editable plots with dml
. However, you can
include interactive html widgets.
eha_avenir_xar(aspect = "16x9", self_contained = TRUE, ...)
eha_avenir_xar(aspect = "16x9", self_contained = TRUE, ...)
aspect |
String. Aspect ratio for slides. Either "16x9" or "4x3". Default is "16x9" |
self_contained |
Whether to produce a self-contained HTML file by embedding all external resources into the HTML file. |
... |
other arguments passed to |
xaringan theme
Styles for eha rmarkdown ppt. Used with a template to create presentations that dynamically update with your data.
eha_classic_pptx( aspect = "16x9", master = "EcoHealth Alliance", toc = FALSE, toc_depth = 2, fig_width = 9.4, fig_height = 4.24, fig_caption = TRUE, df_print = "default", keep_md = FALSE, smart = TRUE, md_extensions = NULL, slide_level = NULL, pandoc_args = NULL )
eha_classic_pptx( aspect = "16x9", master = "EcoHealth Alliance", toc = FALSE, toc_depth = 2, fig_width = 9.4, fig_height = 4.24, fig_caption = TRUE, df_print = "default", keep_md = FALSE, smart = TRUE, md_extensions = NULL, slide_level = NULL, pandoc_args = NULL )
aspect |
String. Aspect ratio for power point slides. Either "16x9" or "4x3". Default is "16x9" |
master |
String. Name of slide master for template ppt
Use |
toc |
Logical. Should the slides have a table of contents? Default is FALSE |
toc_depth |
Numeric. How many levels should the table of contents have. Default is 2. |
fig_width |
Numeric. Width of figures. Default is 9.4 |
fig_height |
Numeric. Height of figures. Default is 4.24 |
fig_caption |
Logical. Should figures have captions? Default is TRUE |
df_print |
String. Print data frames? Default is "default" |
keep_md |
Logical. Should markdown document be kept? Default is FALSE |
smart |
Logical. Produce typographically correct outs. Default is TRUE |
md_extensions |
String. Additional markdown extensions. Default is NULL |
slide_level |
Numeric. Defines the heading level that defines individual slides. Default is NULL |
pandoc_args |
Arguments to pass to pandoc |
powerpoint_presentation
, rpptx_document
A function to produce an EHA Xaringan theme with the classic font. This
function leans on style_mono_light
for many of
the theme arguments. It uses moon_reader
to create
the markdown renderable object. Unlike eha_classic_pptx
, you
cannot create editable plots with dml
. However, you can
include interactive html widgets.
eha_classic_xar(aspect = "16x9", self_contained = TRUE, ...)
eha_classic_xar(aspect = "16x9", self_contained = TRUE, ...)
aspect |
String. Aspect ratio for slides. Either "16x9" or "4x3". Default is "16x9" |
self_contained |
Whether to produce a self-contained HTML file by embedding all external resources into the HTML file. |
... |
other arguments passed to |
xaringan theme
There is an issue using sysfonts
with
M1 mac machines thereforetheme_xaringan
is not
able to use google_font
when creating ggplot themes.
Function to create a custom flexdashboard theme for EHA.
eha_flex_dashboard( orientation = "rows", bg = "#224A55", fg = "#5EB9D6", primary = "#97C83E", secondary = "#B0A28A", version = 4, fontUrl = "https://font-avenir.s3.us-east-2.amazonaws.com/AvenirLTW04-85Heavy.woff2", family = "Avenir", style = "normal", weight = "500", ... )
eha_flex_dashboard( orientation = "rows", bg = "#224A55", fg = "#5EB9D6", primary = "#97C83E", secondary = "#B0A28A", version = 4, fontUrl = "https://font-avenir.s3.us-east-2.amazonaws.com/AvenirLTW04-85Heavy.woff2", family = "Avenir", style = "normal", weight = "500", ... )
orientation |
Determines whether level 2 headings are treated as dashboard rows or dashboard columns. |
bg |
Background color for |
fg |
Foreground color for |
primary |
Primary color for |
secondary |
Secondary color for code |
version |
Bootstrap version to use with |
fontUrl |
URL where font is hosted |
family |
String. Name of font family when using fontURL |
style |
String. Name of font style. Choose from normal, italic,oblique, initial, or inherit |
weight |
String. Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold. Can also use normal, bold, bolder, or lighter |
... |
Additional arguments to be passed to |
function
See W3 description of font property for additional details about customizing fonts.
flexdashboard::flex_dashboard()
bslib::bs_theme()
Function to create a custom flexdashboard theme for EHA.
eha_flex_dashboard_light( orientation = "rows", bg = "#f7fdff", fg = "#5EB9D6", primary = "#97C83E", secondary = "#B0A28A", version = 4, fontUrl = "https://font-avenir.s3.us-east-2.amazonaws.com/AvenirLTW04-85Heavy.woff2", family = "Avenir", style = "normal", weight = "500", ... )
eha_flex_dashboard_light( orientation = "rows", bg = "#f7fdff", fg = "#5EB9D6", primary = "#97C83E", secondary = "#B0A28A", version = 4, fontUrl = "https://font-avenir.s3.us-east-2.amazonaws.com/AvenirLTW04-85Heavy.woff2", family = "Avenir", style = "normal", weight = "500", ... )
orientation |
Determines whether level 2 headings are treated as dashboard rows or dashboard columns. |
bg |
Background color for |
fg |
Foreground color for |
primary |
Primary color for |
secondary |
Secondary color for code |
version |
Bootstrap version to use with |
fontUrl |
URL where font is hosted |
family |
String. Name of font family when using fontURL |
style |
String. Name of font style. Choose from normal, italic,oblique, initial, or inherit |
weight |
String. Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold. Can also use normal, bold, bolder, or lighter |
... |
Additional arguments to be passed to |
function
See W3 description of font property for additional details about customizing fonts.
flexdashboard::flex_dashboard()
bslib::bs_theme()
This is a thin wrapper around the linl::linl()
function which prints letters,
automatically using the EHA letterhead. See that function's options for
further
eha_letter(...)
eha_letter(...)
... |
Additional parameters to pass to |
Open avenir, classic, and predict powerpoint templates. Providing no arguments will open all six templates. Providing either an aspect or a template will return all the corresponding templates. For example, if classic is provided to template, then classic 16x9 and classic 4x3 will be opened.
eha_pptx_template( template = c("classic", "avenir", "predict"), aspect = c("16x9", "4x3"), outdir = "./", recursive = TRUE )
eha_pptx_template( template = c("classic", "avenir", "predict"), aspect = c("16x9", "4x3"), outdir = "./", recursive = TRUE )
template |
String. Either classic or avenir. Defines the template to be use. |
aspect |
String. Either 16x9 or 4x3. Defines the aspect ratio of the slides |
outdir |
String. Where should files be copied to before opening? |
recursive |
Logical. Should elements of the path other than the last be
created? If true, like the Unix command mkdir -p. See |
pptx
#open all the templates ## Not run: eha_pptx_template()
#open all the templates ## Not run: eha_pptx_template()
R Markdown format for EHA Outbreak Scenarios Reports
outbreak( self_contained = TRUE, lib_dir = NULL, keep_md = FALSE, cache_prefix = "cache/", ... )
outbreak( self_contained = TRUE, lib_dir = NULL, keep_md = FALSE, cache_prefix = "cache/", ... )
self_contained |
Include all dependencies |
lib_dir |
Local directory to copy assets |
keep_md |
Keep knitr-generated markdown |
cache_prefix |
String. Prefix for cache |
... |
Additional function arguments to pass to the base R Markdown HTML output formatter |
theme |
Bootstrap theme |
mathjax |
Include mathjax, "local" or "default" |
pandoc_args |
Other arguments to pass to pandoc |
Create output for Word document
outbreak_word( cache_prefix = "cache/", keep_md = FALSE, proposal = FALSE, usaid = FALSE, usaid_panel = 1, ... )
outbreak_word( cache_prefix = "cache/", keep_md = FALSE, proposal = FALSE, usaid = FALSE, usaid_panel = 1, ... )
cache_prefix |
String. Prefix for cache |
keep_md |
Logical. Keep the markdown file generated by knitting. Note that if this is TRUE then clean_supporting will always be FALSE. |
proposal |
Logical. Should the proposal format be used. |
usaid |
Logical. Should the USAID format be used |
usaid_panel |
Numeric. Which USAID sidebar image should be used (1,2, or 4)? |
... |
Additional arguments to pass to |
knitr_options
, output_format
, word_document
Checks for duplicate PH elements that would break rendering.
ph_duplicate_check(ppt_template, print = FALSE)
ph_duplicate_check(ppt_template, print = FALSE)
ppt_template |
String. Path to ppt template |
print |
Logical. Should the dataframe be printed? |
dataframe
This function allows you to easily source package resources like images or style sheets. The function will return a file path to a resource stored in your package.
pkg_resource(...)
pkg_resource(...)
... |
arguments to pass to |
string
logoEHA <- pkg_resource("eha_icon_logo.png") print(logoEHA)
logoEHA <- pkg_resource("eha_icon_logo.png") print(logoEHA)
Checks for duplicate ph elements using ph_duplicate_check
and
matching master arguments using ppt_layout
.
ppt_check(ppt_template, master, print = FALSE)
ppt_check(ppt_template, master, print = FALSE)
ppt_template |
String. Path to ppt template |
master |
String. Name of master slide template |
print |
Logical. Should items be printed |
message
Convenience wrapper forlayout_summary
used to debug
issues with powerpoint templates. Returns a list with first element containing
the master names and the second element containing layout and master names for
a given ppt.
ppt_layout(ppt_template, print = FALSE)
ppt_layout(ppt_template, print = FALSE)
ppt_template |
String. Path to ppt file |
print |
Logical. Should layout be printed |
data.frame
Dataset containing speaker locations and labels.
speakerLocations
speakerLocations
A data frame with 8 rows and 6 variables:
institution associated with speaker
location of institution
latitude of institution
longitude of institution
number of talks from that institution
summary of institution statistics
...
airtable app id appwlxIzmQx5njRtQ as of 24 June 2021