Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shiny)
- library("xlsx")
- ui<-fluidPage(
- fileInput("file1","Choose xlsx file",
- accept = c(".xlsx")),
- downloadButton("file2","Download Modified File")
- )
- server <- function(input, output){
- output$contents <- renderTable({
- req(input$file1)
- f1 <- cbind(read.xlsx(input$file1$datapath,3),
- read.xlsx(input$file1$datapath,4))
- })
- output$downloadData <- downloadHandler(
- filename = function() {
- paste(output$file2$datapath,"xlsx",sep = ".")
- },
- content = function(file) {
- write.xlsx(f1, file)
- }
- )
- }
- shinyApp(ui=ui, server=server)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement