Skip to content

Instantly share code, notes, and snippets.

@hansen-m
Created March 26, 2019 19:47
Show Gist options
  • Save hansen-m/fcd31b5d98e26eca5e83cf7af0996352 to your computer and use it in GitHub Desktop.
Save hansen-m/fcd31b5d98e26eca5e83cf7af0996352 to your computer and use it in GitHub Desktop.
#
# This is the server logic of a Shiny web application. You can run the
# application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
# Server
shinyServer(function(input, output) {
shinyDirChoose(input, 'files', root=c(root='.'))
shinyFileChoose(input, 'files', root=c(root='.'))
#path <- Sys.getenv("R_SESSION_TMPDIR")
path <- "."
files <- list.files(path = path, full.names = TRUE, recursive = TRUE)
output$table <- renderTable(files)
})
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(shinyFiles)
# UI
shinyUI(basicPage(
shinyFilesButton('files', label='Files Browse', title='Select a file', multiple=FALSE),
shinyDirButton('files', label='Folder Browse', title='Select a folder'),
tableOutput('table')
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment