Learn R Programming

i2dash (version 0.2.4)

assemble: Generate an RMarkdown file from an i2dashboard object.

Description

Generate an RMarkdown file from an i2dashboard object.

Usage

assemble(dashboard, ...)

# S4 method for i2dashboard assemble( dashboard, file, pages = names(dashboard@pages), exclude = NULL, render = FALSE, ... )

Value

Invisibly returns the unmodified i2dashboard object.

Arguments

dashboard

A i2dashboard.

...

Additional arguments passed on to 'rmarkdown::render()'.

file

The path and filename of the resulting Rmd file (recommend that the suffix should be '.Rmd').

pages

A string or vector with the names of pages, which should be assembled into the resulting Rmd file

exclude

A string or vector with the names of pages, which should be excluded from dashboard assembly.

render

A logical indicating whether the assembled dashboard should immediately be rendered with 'rmarkdown::render()' or run with 'rmarkdown::run()'.

Examples

Run this code
# \donttest{
i2dashboard() %>% assemble(file="MyDashboard.Rmd")
i2dashboard() %>%
    add_page("p1", "Title 1") %>%
    add_page("p2", "Title 2") %>%
    assemble(file="MyDashboard.Rmd", exclude="default", render=TRUE)
# }

Run the code above in your browser using DataLab