SHARE
TWEET

Untitled

a guest Jul 19th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```{r UI inputs}
  2. wellPanel(
  3.   fileInput("dataset", label = "Select a .csv File to upload",
  4.             accept=c("text/csv",
  5.                      "text/comma-separated-values,text/plain",
  6.                      ".csv")),
  7.  
  8. actionButton(inputId = "loadbutton", label = "Load Data")
  9. )
  10.  
  11. dataTableOutput("df")
  12.  
  13. ```
  14.  
  15. ```{r Server Functions}
  16. load_table <- eventReactive(input$loadbutton, {
  17.     # input$file1 will be NULL initially. After the user selects
  18.     # and uploads a file, it will be a data frame with 'name',
  19.     # 'size', 'type', and 'datapath' columns. The 'datapath'
  20.     # column will contain the local filenames where the data can
  21.     # be found.
  22.     inFile <- input$dataset
  23.  
  24.     if (is.null(inFile)){
  25.       return(NULL)}
  26.     else {
  27.       read.csv(inFile$datapath)}
  28.     })
  29.  
  30. output$df <- renderDataTable({
  31.   load_table()
  32. })
  33. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top