Skip to content
Snippets Groups Projects
Commit dddf1655 authored by jens.preussner's avatar jens.preussner :ghost:
Browse files

See merge request !32

parents fed1a5b3 3969aea3
No related branches found
No related tags found
1 merge request!32Docu examples
Pipeline #133466 failed
......@@ -11,12 +11,13 @@
#'
#' @rdname assemble
#' @examples
#' library(magrittr)
#' \dontrun{
#' i2dashboard() %>% assemble()
#' i2dashboard() %>%
#' add_page("p1", "Title 1") %>%
#' add_page("p2", "Title 2") %>%
#' assemble(file="MyDashboard.Rmd", exclude="default", render=TRUE)
#' }
setMethod("assemble", "i2dashboard", function(dashboard, pages = names(dashboard@pages), file = dashboard@file, exclude = NULL, render = FALSE, ...) {
. = NULL # workaround for R CMD check note: no visible binding for global variable '.'
tmp_document <- tempfile()
......
......@@ -101,6 +101,7 @@ setMethod("show", "i2dashboard", function(object) {
#' @rdname i2dashboard-class
#' @export
#' @examples
#' \dontrun{
#' dashboard <- i2dashboard()
#' dashboard <- i2dashboard(
#' title = "Dashboard title",
......@@ -111,8 +112,8 @@ setMethod("show", "i2dashboard", function(object) {
#' file = "MyDashboard.Rmd",
#' source = "embed"
#' )
#'
#' # inspect dashboard:
#' #' # inspect dashboard:
#' show(dashboard)
#' dashboard
#' }
i2dashboard <- function(...) methods::new("i2dashboard", ...)
......@@ -36,10 +36,11 @@ Invisibly returns the unmodified \linkS4class{i2dashboard} object.
Generate an RMarkdown file from an \linkS4class{i2dashboard} object.
}
\examples{
library(magrittr)
\dontrun{
i2dashboard() \%>\% assemble()
i2dashboard() \%>\%
add_page("p1", "Title 1") \%>\%
add_page("p2", "Title 2") \%>\%
assemble(file="MyDashboard.Rmd", exclude="default", render=TRUE)
}
}
......@@ -58,6 +58,7 @@ The \linkS4class{i2dashboard} S4 class provides main functionality of the packag
}}
\examples{
\dontrun{
dashboard <- i2dashboard()
dashboard <- i2dashboard(
title = "Dashboard title",
......@@ -68,8 +69,8 @@ dashboard <- i2dashboard(
file = "MyDashboard.Rmd",
source = "embed"
)
# inspect dashboard:
#' # inspect dashboard:
show(dashboard)
dashboard
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment