View source: R/format_data_extract.R
format_data_extract | R Documentation |
Returns a human-readable string representation of an extracted data_extract_spec
object.
format_data_extract(data_extract)
data_extract |
|
This function formats the output of data_extract_srv
.
See the example for more information.
character(1)
representation of the data_extract
object.
library(shiny)
simple_des <- data_extract_spec(
dataname = "iris",
filter = filter_spec(vars = "Petal.Length", choices = c("1.4", "1.5")),
select = select_spec(choices = c("Petal.Length", "Species"))
)
ui <- fluidPage(
data_extract_ui(
id = "extract",
label = "data extract ui",
data_extract_spec = simple_des,
is_single_dataset = TRUE
),
verbatimTextOutput("formatted_extract")
)
server <- function(input, output, session) {
extracted_input <- data_extract_srv(
id = "extract",
datasets = list(iris = iris),
data_extract_spec = simple_des
)
output$formatted_extract <- renderPrint({
cat(format_data_extract(extracted_input()))
})
}
if (interactive()) {
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.