dataOutput | R Documentation |
Shiny module for data output
dataOutputUI(id, icon = "download") dataOutputServer( id, data = reactive(NULL), save_as = NULL, write_fun = "write.csv", write_args = NULL, hide = FALSE, hover_text = NULL )
id |
unique identifier for the module to prevent namespace clashes when making multiple calls to this shiny module. |
icon |
supplied to |
data |
an object of class data.frame wrapped in |
save_as |
name of the file to which the data should be saved, overrides input file path if supplied. |
write_fun |
name of the function to use when writing the data to file,
set to |
write_args |
a named list of additional arguments to pass to
|
hide |
logical indicating whether the data input user interface should be hidden from the user, set to FALSE by default. |
hover_text |
text to display on download button when user hovers cursor over button, set to NULL by default to turn off hover text. |
Dillon Hammill, Dillon.Hammill@anu.edu.au
if (interactive()) { library(shiny) library(rhandsontable) library(shinyjs) ui <- fluidPage( useShinyjs(), dataInputUI("input1"), dataOutputUI("output1"), rHandsontableOutput("data1") ) server <- function(input, output, session) { data_input1 <- dataInputServer("input1") output$data1 <- renderRHandsontable({ if (!is.null(data_input1())) { rhandsontable(data_input1()) } }) dataOutputServer("output1", data = data_input1 ) } shinyApp(ui, server) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.