flex_dashboard {flexdashboard} | R Documentation |
R Markdown Format for Flexible Dashboards
Description
Format for converting an R Markdown document to a grid oriented dashboard layout. The dashboard flexibly adapts the size of it's plots and htmlwidgets to its containing web page.
Usage
flex_dashboard(
fig_width = 6,
fig_height = 4.8,
fig_retina = 2,
fig_mobile = TRUE,
dev = "png",
self_contained = TRUE,
favicon = NULL,
logo = NULL,
social = NULL,
source_code = NULL,
navbar = NULL,
orientation = c("columns", "rows"),
vertical_layout = c("fill", "scroll"),
storyboard = FALSE,
theme = "default",
highlight = "default",
mathjax = "default",
extra_dependencies = NULL,
css = NULL,
includes = NULL,
lib_dir = NULL,
md_extensions = NULL,
pandoc_args = NULL,
devel = FALSE,
resize_reload = TRUE,
...
)
Arguments
fig_width |
Default width (in inches) for figures |
fig_height |
Default height (in inches) for figures |
fig_retina |
Scaling to perform for retina displays (defaults to 2). Note that for flexdashboard enabling retina scaling provides for both crisper graphics on retina screens but also much higher quality auto-scaling of R graphics within flexdashboard containers. |
fig_mobile |
Create an additional rendering of each R graphics figure
optimized for rendering on mobile devices oriented in portrait mode. If
|
dev |
Graphics device to use for figure output (defaults to png) |
self_contained |
Produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Note that even for self contained documents MathJax is still loaded externally (this is necessary because of its size). |
favicon |
Path to graphic to be used as a favicon for the dashboard. Pass
|
logo |
Path to graphic to be used as a logo for the dashboard. Pass
|
social |
Specify a character vector of social sharing services to
automatically add sharing links for them on the |
source_code |
URL for source code of dashboard (used primarily for
publishing flexdashboard examples). Automatically creates a |
navbar |
Optional list of elements to be placed on the flexdashboard
navigation bar. Each element should be a list containing a |
orientation |
Determines whether level 2 headings are treated as dashboard rows or dashboard columns. |
vertical_layout |
Vertical layout behavior: "fill" to vertically resize charts so they completely fill the page; "scroll" to layout charts at their natural height, scrolling the page if necessary. |
storyboard |
|
theme |
One of the following: * A [bslib::bs_theme()] object (or a list of [bslib::bs_theme()] argument values) * Use this option to choose any [Bootstrap version](https://rstudio.github.io/bslib/articles/bslib.html#bootstrap-versions), [Bootswatch theme](https://rstudio.github.io/bslib/articles/bslib.html#bootswatch-themes), or implement a [custom theme](https://rstudio.github.io/bslib/articles/bslib.html#custom-themes). * In this case, any '.scss'/'.sass' files provided to the 'css' parameter may utilize the ‘theme'’s underlying Sass utilities (e.g., variables, mixins, etc). * A character string specifying a [Bootswatch 3](https://bootswatch.com/3/) theme name (for backwards-compatibility). The "cosmo" theme is used when "default" is specified. |
highlight |
Syntax highlighting style. Supported styles include "default", "tango", "pygments", "kate", "monochrome", "espresso", "zenburn", and "haddock". Pass NULL to prevent syntax highlighting. |
mathjax |
Include mathjax. The "default" option uses an https URL from a
MathJax CDN. The "local" option uses a local version of MathJax (which is
copied into the output directory). You can pass an alternate URL or pass
|
extra_dependencies |
Extra dependencies as a list of the
|
css |
CSS and/or Sass files to include. Files with an extension of .sass
or .scss are compiled to CSS via |
includes |
Named list of additional content to include within the
document (typically created using the |
lib_dir |
Directory to copy dependent HTML libraries (e.g. jquery,
bootstrap, etc.) into. By default this will be the name of the document with
|
md_extensions |
Markdown extensions to be added or removed from the
default definition of R Markdown. See the |
pandoc_args |
Additional command line options to pass to pandoc |
devel |
Enable development mode (used for development of the format itself, not useful for users of the format). |
resize_reload |
Disable the auto-reloading behavior when the window is resized. Useful when debugging large flexdashboard applications and this functionality is not needed. |
... |
Other arguments to [rmarkdown::html_document_base()]. |
Details
See the flexdashboard website for additional documentation: https://pkgs.rstudio.com/flexdashboard/
Examples
## Not run:
library(rmarkdown)
library(flexdashboard)
# simple invocation
render("dashboard.Rmd", flex_dashboard())
# specify the theme option
render("pres.Rmd", flex_dashboard(theme = "yeti"))
## End(Not run)