Skip to contents

The sgtourism R package contains the code to produce the official St.Gallen tourism dashboard.

Launch the app

Install the R package with:

install.packages("sgtourism", repos = "https://swissstatsr.r-universe.dev")
# remotes::install_github("statistikSG/sgtourism")

Then launch the app locally:

# Run the application
sgtourism::run_app()

How to reuse the app

What if you want to use a different version of sgtourism for your own project? We recommend to clone the GitHub repository locally first.

As your own environment may differ from ours, a stratagy could be to take advantage of the “renv.lock.prod” file to set up the R package dependencies:

# install.packages("renv")
# renv::activate() # run first
renv::restore(lockfile = "deploy/renv.lock.prod")

Learn more about renv here.

Another strategy could be to install all R packages dependencies of sgtourism:

devtools::install()

How to use your own data

This R shiny application is transformed as an R package using the golem framework.

To update the data, you should first replace our CSV files with your own files in the /data-raw folder.

Then you should run the related R script in the “data-raw” folder to replace the internal RDA file datasets in the /data folder.

Once it is done, you can go to /dev/03_deploy.R for testing and deploying your application.

Contribute

Any contribution is strongly appreciated. Feel free to report a bug, ask any question or make a pull request for any remaining issue.