harpomaxx commited on
Commit
1aabb2d
1 Parent(s): 4109000

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +12 -7
app.R CHANGED
@@ -179,15 +179,20 @@ ui <- fluidPage(
179
  server <- function(input, output) {
180
 
181
  # For the predictions dataset
 
 
 
 
182
  predictions <- reactive({
183
-
184
- if (is.null(input$file1))
185
- return(NULL)
186
-
187
- inFile <- input$file1
188
- dataset <- readr::read_delim(inFile$datapath,delim='\t')
 
 
189
  predict(model, dataset)
190
-
191
  })
192
 
193
  # For the table
 
179
  server <- function(input, output) {
180
 
181
  # For the predictions dataset
182
+
183
+ # Path to the default file
184
+ default_file_path <- "./dataset_b.tsv"
185
+
186
  predictions <- reactive({
187
+ # Use default file if no file is uploaded
188
+ file_path <- if (is.null(input$file1)) {
189
+ default_file_path
190
+ } else {
191
+ input$file1$datapath
192
+ }
193
+
194
+ dataset <- readr::read_delim(file_path, delim='\t')
195
  predict(model, dataset)
 
196
  })
197
 
198
  # For the table