R-package to be used to produce maps on the helseatlas.no web page.
A working document on the process of going from IA to RShiny can be found here (read only).
How to install the package
You have the run the following command first if you are behind Helse Nord proxy:
How to use the package
The input to the shiny app is a data frame containing the following columns:
area level1 (level2) # optional (level3) # optional rate numerater name_numerater denominator name_denominator
If you want to test the package you can use a dataset shipped with the package, namely
Run the command
shinymap::launch_application(dataset = <dataset>)
Submit to shinyapps.io
Run the command
shinymap::launch_application(dataset = <r data frame>, publish_app = TRUE, name = <appName>, shiny_account = <publishing account>)
Make sure that the version of shinymap installed and active in your Rsession is installed directly from github, since it also has to be installed on shinyapps.io. Also remember to connect to your shinyapps.io profile.
Run a local copy of the package
- Download the package from github
git clone email@example.com:helseatlas/shinymap
- Open the
shinymapfolder in RStudio
- Install required packages, if not installed already. This can be done by
devtools::install_github("Helseatlas/shinymap"). This will install the shinymap package from github and at the same time install all the required packages.
- Build the package (Ctrl+Shift+B on Windows/Linux or ⌘-⇧-B on Mac).
- Put some data in
healthatlas_dataand define some parametres
healthatlas_data <- shinymap::kols # or another dataset to use language <- "no" # or "en" webpage_title <- "Helseatlas kols 2013-2015"
- Run the app, either by open the file
inst/app/server.Rand push the button or
- Fork me
- Clone your fork (replace
<usernamewith your github user name), create a branch and push it
git clone firstname.lastname@example.org:<username>/shinymap cd shinymap git checkout -b super-duper-idea git push -u origin super-duper-idea
- Do your changes, commit your changes and push your changes (please remember to add tests and documentation!)
git add . git commit -m 'My super duper idea' git push
- Create a pull request (PR).
- Wait for PR to me reviewed and tested.