knitr::opts_chunk$set(echo = TRUE)

Get GitHub Repository TopoSUB or install R library

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")

Dependencies

Before running the app make sure you have installed the following libraries

  1. data.table an extension of data.frame - a table plug-in for jQuery,
  2. tidyr makes it easy to “tidy” your data. Tidy data is data that’s easy to work with: it’s easy to munge (with dplyr), visualise (with ggplot2), ...
  3. dplyr providing a set of tools for efficiently manipulating datasets in R,
  4. raster for Geographic Data Analysis and Modeling,
  5. ggplot2 ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and none of the bad parts,
  6. leaflet is one of the most popular open-source JavaScript libraries for interactive maps,
  7. shiny a web application framework for R.
install.packages(c("data.table","tidyr","dplyr","raster","ggplot2","leaflet","shiny"))

Running the shiny application

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.

Station vise validation

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.

Requirements



JBrenn/TopoSUB documentation built on May 7, 2019, 7:39 a.m.