Description Usage Arguments Examples
A shiny module to edit (add, edit, remove rows) a dataframe and export the result. It is strongly inspired from https://github.com/cardiomoon/editData
1 2 3 4 | mod_edit_tableUI(id)
mod_edit_table(input, output, session, data = reactive(NULL),
width = 250, path, filename)
|
id |
shiny id |
input |
internal |
output |
internal |
session |
internal |
data |
reactive dataframe value |
width |
width of the Input |
path |
reactive string value. The path to the directory where the file will be exported |
filename |
string value. The name of the file when exported |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(shiny)
library(DT)
library(readr)
library(tibble)
if (interactive()) {
ui <- fluidPage(
textInput("mydata","Enter data name",value="mtcars"),
mod_edit_tableUI("loadfile"),
h4("Choose a path"),
textInput("path", value = getwd(), label = NULL),
h4("Choose a filename (do not forget the extension)"),
textInput("filename", value = "", label = NULL)
)
server <- function(input, output, session) {
data <- reactive(data(input$mydata))
editdata <- callModule(mod_loading_options,"loadfile", data = data,
path = reactive(input$path), filename = input$filename)
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.