tm_front_page {teal.modules.general} | R Documentation |
teal
module: Front page
Description
Creates a simple front page for teal
applications, displaying
introductory text, tables, additional html
or shiny
tags, and footnotes.
Usage
tm_front_page(
label = "Front page",
header_text = character(0),
tables = list(),
additional_tags = tagList(),
footnotes = character(0),
show_metadata = FALSE
)
Arguments
label |
( |
header_text |
( |
tables |
( |
additional_tags |
( |
footnotes |
( |
show_metadata |
( |
Value
Object of class teal_module
to be used in teal
applications.
Examples
data <- teal_data()
data <- within(data, {
require(nestcolor)
ADSL <- rADSL
attr(ADSL, "metadata") <- list("Author" = "NEST team", "data_source" = "synthetic data")
})
datanames(data) <- "ADSL"
join_keys(data) <- default_cdisc_join_keys[datanames(data)]
table_1 <- data.frame(Info = c("A", "B"), Text = c("A", "B"))
table_2 <- data.frame(`Column 1` = c("C", "D"), `Column 2` = c(5.5, 6.6), `Column 3` = c("A", "B"))
table_3 <- data.frame(Info = c("E", "F"), Text = c("G", "H"))
table_input <- list(
"Table 1" = table_1,
"Table 2" = table_2,
"Table 3" = table_3
)
app <- init(
data = data,
modules = modules(
tm_front_page(
header_text = c(
"Important information" = "It can go here.",
"Other information" = "Can go here."
),
tables = table_input,
additional_tags = HTML("Additional HTML or shiny tags go here <br>"),
footnotes = c("X" = "is the first footnote", "Y is the second footnote"),
show_metadata = TRUE
)
),
header = tags$h1("Sample Application"),
footer = tags$p("Application footer"),
)
if (interactive()) {
shinyApp(app$ui, app$server)
}