I would like to develop a bunch of Shiny apps, each of them working (and editing) the same set of data. Is that feasible and if yes, how should the project be structured?
1 Shiny app
The way I am used to structure my shiny app is the following:

2+ Shiny apps
Is there a way to refer to another location for the data, or to store apps within the root folder this way:
,
each app using data located in the data folder. For each app, ui.R, server.R and global.R are stored in the 'app_i' folder.
From what I know ui.R, server.R and global.R should always be located at the root of the project, which makes it impossible to work with multiple apps on the same dataset..
Thank you in advance for your views on this, and for sharing best practices.
Regards
ui.R, server.R and global.R have to be in the root directory of your app but any of these can access files outside the root. Few options you have here are:
use absolute path to your data directory when you access files
DATA_PATH <- "/path/to/data/"
use relative path
DATA_PATH <- file.path(getwd(), "../data/")
use symlinks
.
├── app1
│ ├── data -> /path/to/data
│ ├── server.R
│ └── ui.R
├── app2
│ ├── data -> /path/to/data
│ ├── server.R
│ └── ui.R
├── app3
│ ├── data -> /path/to/data
│ ├── server.R
│ └── ui.R
└── data
├── bar.csv
└── foo.csv
for read only data sets you can create a data-only package using standard R tools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With