Karl Ho
School of Economic, Political and Policy Sciences
University of Texas at Dallas
Workshop prepared for National Chung Hsing University
December 19, 2020
Module 1:
Module 2:
Module 3:
Multibeam sonar backscatter data draped on bathymetry off Santa Monica Calif. Yellow is high backscatter. Santa Monica sewer pipe and diffuser is visible in upper part of image (y-shaped feature). Red-brown dots represent color-coded fish abundance as determined from trawl data.
Source: https://tinyurl.com/ydhqtr8f
Source: Yau 2011
> >
= =
Source: https://en.wikipedia.org/wiki/Charles_Joseph_Minard
How much information?
1. Latitude of army & features (Y-coordinate) . 2. Longitude of army & features (X-coordinate)
3. Size of army (width of line, numerals) . 4. Advance vs. Retreat color of line
5. Division of army splitting of line 6. Temperature linked lineplot
7. Time linked lineplot
# install.packages("shiny")
# install.packages("shinythemes")
library(shiny)
library(shinythemes)
# Create User Interface
ui <− fluidPage ()
# Build R objects displayed in UI
server <− function(input , output){}
# Create Shiny app
shinyApp(ui = ui, server = server)
ui: Nested R functions that assemble an HTML user interface for the app (some HTML knowledge needed)
server: A function with instructions on how to build and rebuild the R objects displayed in the UI
shinyApp: Combines ui and server into a functioning app
library(shiny)
ui = fluidPage(
numericInput(inputId = "n", "Sample size", value = 50),
plotOutput(outputId = "hist"))
server = function(input , output){ output$hist = renderPlot ({
hist(rnorm(input$n)) })}
shinyApp(ui = ui , server = server)
Reactive values work together with reactive functions. Call a reactive value from within the arguments of one of these functions to avoid the error
Operation not allowed without an active reactive context.
fileInput(inputId, label, multiple, accept)
numericInput(inputId, label, value, min, max, step)
passwordInput(inputId, label, value)
radioButtons(inputId, label, choices, selected, inline)
selectInput(inputId, label, choices, selected, multiple, selectize, width, size) (also selectizeInput())
sliderInput(inputId, label, min, max, value, step, round, format, locale, ticks, animate, width, sep, pre, post)