Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shiny)
- if (interactive()) {
- ui <- fluidPage(
- downloadButton("downloadData", "Download")
- )
- server <- function(input, output) {
- # Our dataset
- data <- mtcars
- output$downloadData <- downloadHandler(
- filename = paste("example",gsub(":","-",Sys.time()), ".csv", sep=""),
- content = function(file) {
- write.csv(mtcars,file)
- }
- )
- }
- runApp(list(ui=ui,server=server),launch.browser=T)
- }
- library(shiny)
- if (interactive()) {
- ui <- fluidPage(
- downloadButton("downloadData", "Download")
- )
- server <- function(input, output) {
- # Our dataset
- data <- mtcars
- output$downloadData <- downloadHandler(
- filename = function(){
- paste("example",gsub(":","-",Sys.time()), ".csv", sep="")
- },
- content = function(file) {
- write.csv(mtcars,file)
- }
- )
- }
- runApp(list(ui=ui,server=server),launch.browser=T)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement