knitr::opts_chunk$set(echo = TRUE)
Before starting download and unzip OR clone the GitHub repository TopoSUB:
git clone https://github.com/JBrenn/TopoSUB
Copy the files within the shiny folder (ui.R, server.R, runApp.R) in your TopoSUB simulation folder.
If the R library TopoSUB is already installed you will find the shiny folder in your package installation folder. The package installation path can be found like follows:
find.package("TopoSUB")
Before running the app make sure you have installed the following libraries
install.packages(c("data.table","tidyr","dplyr","raster","ggplot2","leaflet","shiny"))
Close RStudio, and double-click runApp.R (in the TopoSUB simulation folder). This should open the R script in RStudio with your TopoSUB simulation folder as a working directory. The working directory is written above the R console, you can also check with
getwd()
Execute the whole script:
library(shiny) library(leaflet) library(raster) library(data.table) library(tidyr) library(dplyr) library(ggplot2) runApp(getwd())
A browser window should open and show the shiny app interface. If your data is stored on a server reading map files is slow. You can improve speed by copying the simuation folder (at least the folders OUTperiods and OUTcsv, as well as the file listpoints.txt) on your local machine.
For information on the formating of the observation data see Lect 1 RunTopoSUB. The R markdown document Verification GEOtop-TopoSUB point simulation.Rmd acts as validation script, you can get it from the TopoSUB GitHUB repository.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.