harpomaxx commited on
Commit
25d3760
·
1 Parent(s): 8cd7f76

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +9 -8
app.R CHANGED
@@ -198,15 +198,16 @@ server <- function(input, output) {
198
  # For the table
199
  output$contents <- renderTable({
200
 
201
- # input$file1 will be NULL initially. After the user selects
202
- # a file, it will be a data frame with 'name', 'size', 'type', and 'datapath' variables.
203
- inFile <- input$file1
204
-
205
- if (is.null(inFile))
206
- return(NULL)
207
 
208
- # Read the file from the input$file1 path and return it
209
- dataset <- readr::read_delim(inFile$datapath,delim='\t')
 
 
 
 
 
 
 
210
  head(dataset, n = 5)
211
  })
212
 
 
198
  # For the table
199
  output$contents <- renderTable({
200
 
 
 
 
 
 
 
201
 
202
+ # a file, it will be a data frame with 'name', 'size', 'type', and 'datapath' variables.
203
+ # Use default file if no file is uploaded
204
+ file_path <- if (is.null(input$file1)) {
205
+ default_file_path
206
+ } else {
207
+ input$file1$datapath
208
+ }
209
+
210
+ dataset <- readr::read_delim(file_path, delim='\t')
211
  head(dataset, n = 5)
212
  })
213