0

I'm trying to download a table generated from a function in server.R and I was trying to call it by input$example that comes from output$example. However, my excel file comes out blank. Does anyone know how to fix this? Here comes my server.R

  **output$sumy** <- renderTable({ 

    input$action

      if(is.null(input$action))
        return(NULL)

      else

       isolate({

         trees2 <- FindTreesCHM(fchm(), (as.numeric(input$fws)), (as.numeric(input$minht)))
         h <- trees2["height"]
         TotalArvores <- nrow(trees2)
         rbind(summary(h), TotalArvores, make.row.names = "Total number of trees")
      })

      })

output$downSumy <- downloadHandler(
    filename = function() {
      paste("Summary of LiDAR metrics", "csv", sep = ".")
    },
    content = function(file) {
      write.table(**input$sumy**, file, sep = ",")
    }


  ) 

Does anyone know if it's even possible to call a function that comes from output within server.R?

Thanks a lot!

  • You cannot use an output as an input. What you can do is to use a global variable to store the table and then you can use it in different output. Another thing is that your `downloadHandler` requires a `contentType` parameter. – Xiongbing Jin Oct 30 '16 at 14:26
  • Hum... I see! Thanks a lot @warmoverflow ! – Iasmim Louriene Oct 30 '16 at 17:27

0 Answers0