shinyFiles v0.7.5
Monthly downloads
A Server-Side File System Viewer for Shiny
Provides functionality for client-side navigation of
the server side file system in shiny apps. In case the app is running
locally this gives the user direct access to the file system without the
need to "download" files to a temporary location. Both file and folder
selection as well as file saving is available.
Readme
shinyFiles 
This package extends the functionality of shiny by providing an API for client side access to the server file system. As many shiny apps are run locally this is equivalent to accessing the filesystem of the users own computer, without the overhead of copying files to temporary locations that is tied to the use of fileInput()
.
The package can be installed from CRAN using install.packages('shinyFiles')
.
Usage
The package is designed to make it extremely easy to implement file system access. An example of implementing a file chooser would be:
In the ui.R file
shinyUI(bootstrapPage(
shinyFilesButton('files', label='File select', title='Please select a file', multiple=FALSE)
))
In the server.R file
shinyServer(function(input, output) {
shinyFileChoose(input, 'files', root=c(root='.'), filetypes=c('', 'txt'))
})
It is equally simple to implement directly in your custom html file as it only requires a single <button>
element. The equivalent of the above in raw html would be:
<button id="files" type="button" class="shinyFiles btn" data-title="Please select a file" data-selecttype="single">
File select
</button>
For an overview of all the different modules try the shinyFilesExample()
function in the package. It gives an overview of all the necessary code, along with descriptions and working examples.
Credits
- The file icons used in the file system navigator are taken from FatCows Farm-Fresh Web Icons (http://www.fatcow.com/free-icons)
- RStudio is a trademark of RStudio, Inc. File icons used by permission of RStudio, Inc.
Functions in shinyFiles
Name | Description | |
dirGetter | Create a function that updates a folder tree based on the given restrictions | |
updateChildren | Update the children element to reflect current state | |
traverseDirs | Traverse and update a tree representing the file system | |
shinyFilesExample | Run a simple example app using the shinyFiles functionality | |
shinyFiles-buttons | Create a button to summon a shinyFiles dialog | |
fileGetter | Create a function that returns fileinfo according to the given restrictions | |
shinyFiles-package | A Server-Side File System Viewer for Shiny | |
shinyFiles-parsers | Convert the output of a selection to platform specific path(s) | |
formatFiletype | Formats the value of the filetype argument | |
dirCreator | Create a function that creates a new directory | |
getVolumes | Get a list of available volumes | |
shinyFiles-observers | Create a connection to the server side filesystem | |
No Results! |
Last month downloads
Details
Type | Package |
License | GPL (>= 2) |
Encoding | UTF-8 |
Collate | 'aaa.R' 'filechoose.R' 'dirchoose.R' 'filesave.R' 'shinyFiles-package.R' |
RoxygenNote | 6.1.1 |
URL | https://github.com/thomasp85/shinyFiles |
BugReports | https://github.com/thomasp85/shinyFiles/issues |
NeedsCompilation | no |
Packaged | 2019-11-18 09:55:17 UTC; thomas |
Repository | CRAN |
Date/Publication | 2019-11-18 10:30:03 UTC |
imports | fs (>= 1.2.6) , htmltools , jsonlite , shiny (>= 1.1.0) , tibble (>= 1.4.2) , tools |
Contributors | Eric Nantz, Vincent Nijs, Thomas Schaffner |
Include our badge in your README
[](http://www.rdocumentation.org/packages/shinyFiles)