Shiny Dashboard for Silbernetz e.V. Initially developed as part of a CorrelAid data4good volunteering project between 2021 and 2022. Revisited in autumn 2025 to update the app.
app.R- functions in
Rare automatically loaded at startup
- call data is stored in
data/raw/annual/. Each year has its own csv file. - Fake data is provided in
data/raw/annual_fake/. - Real data is not part of this repository due to data protection concerns.
- Real data goes back to
2020-09-05.
data/geo/DEU_admin: shapefile for Bundesländermapping_bula.csv: mapping containing additional information for each Bundeslandmastertable_vorw_bdl.csv: maps Ortskennzahl ("Vorwahl") to Bundesland.
qmd/create_map.qmd: create map without starting appqmd/diagnostics.qmd: some data quality analyses (e.g. duplicates, data coverage)
- install R if not already installed on your system
- Install Font Open Sans on your operating system. You can find the
.tfffiles inassets/font. Google "install tff on [windows|mac|linux]" to find out how to install a font on your operating system.
To get started without accessing the data via the API, you can use the fake data provided with the repository in the folder data/raw/annual_fake/
- Clone or download this repository and place it into a suitable location on your computer.
- install dependencies
install.packages("renv")
renv::restore()- Copy the
.env-templateto.envand set theDATA_FOLDERvariable as follows:
DATA_FOLDER="data/raw/annual_fake/"
- Start the app
shiny::runApp("app.R")
- Clone or download this repository and place it into a suitable location on your computer.
- Obtain a historical dump of the real data and put the csv files into
data/raw/annual/ - install dependencies
install.packages("renv")
renv::restore()- Create
.envfile: Copy.env-templateto.envand fill in values under "Authentication for API". Values can be obtained from your contact at CorrelAid. - Start the app:
shiny::runApp("app.R")
Package management is done with renv.
To install the environment:
install(renv)
renv::restore()
To add new packages:
renv::install("packagename") # installs new package
renv::snapshot() # adds new package to the renv.lock file
For other potentially useful functionality (updating packages...) of renv, refer to the renv documentation.
- Write a bash file that allows to start the app without having to start RStudio looking something like this with the appropriate paths:
"C:/Program Files/R/R-3.6.3/bin/Rscript.exe" -e "shiny::runApp('C:/Users/USER/Desktop/cards', launch.browser = TRUE)"
We encountered the problem that if the default user directory is completely set up with OneDrive so that all files get synchronized, R can run into problems when installing new packages and we weren’t able to install the silbRnetz package. The best way to work around this, was to make sure that R is installed in a directory not linked to OneDrive
- install R
- on machines with admin rights, this will install to
C:\Programme\R\R-4.5.2 - on machines without admin rights, installation location is
C:\Users\[user]\AppData\Local\Programs\R\R-4.5.2
- on machines with admin rights, this will install to
- install R Tools
- install git
- start Git CMD in the background
- manually download 0-clone.bat and double-click on it in the Downloads folder. This should start the command prompt ("Eingabeaufforderung") and clone the repository.
- the content of the repository will be put in
Dieser PC\[name]\Dokumente\silbernetz-dashboard
- open Command prompt ("Eingabeaufforderung")
- cd to project folder:
cd Documents\silbernetz-dashboard C:\Programme\R\R-4.5.2\bin\R- in the R console:
- install
renv:install.packages("renv") renv::install()(not restore wbecause that somehow builds from source?)
- install
Note: installation of s2 package takes a while (> 10 minutes).
- move
.envto project root - move csv files into
data/raw/annual
- put on USB stick:
- installers (Git, R, R Tools)
.envannual0-clone.bat
- insert USB stick into machine and pull all assets into
Downloads - start Git installer and follow default installation except:
- don't use vim but Notepad
- change default branch to main
- don't create menu entry
- simultaneously, start R installer -> follow default installation except:
- don't create Desktop shortcut
- once Git has finished, double click
0-clone.batto clone the repo and open it in the file explorer- copy csv files from
annualinto thedata/raw/annualfolder of the repository - copy
.envinto root folder of repository
- copy csv files from
- once R installation is finished, start installing RTools -> follow default installation
- open command prompt ("Eingabeaufforderung")
cd Documents\silbernetz-dashboard- open R console: Path depends on whether the installation was local or with admin rights (see above). the path within the R folder is
bin/R renvshould start bootstrapping itself, i.e. installing itself
- wait until RTools installation has finished
- then:
renv::install() - in the meantime, create shortcut on Desktop: right click on bat file -> "Weitere Optionen anzeigen" -> "Verknüpfung erstellen" -> copy paste the Verknüpfung to Desktop and potentially rename
windows_deployment/start_dashboard.batfor when the user has admin rights and R was isntalled to C:\Programme- `windows_deployment/start_dashboard_local_rinstall.bat for when the user does not have admin rights and R was installed to C:\Users[user]\AppData... (see above)