Spaces:
Sleeping
Sleeping
Update app.R
Browse files
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 |
-
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|