Skip to main content

Making an Interactive Web Application with R and Shiny

This lesson demonstrates how to build a basic interactive web application using Shiny. Shiny is a library (a set of additional functions) for the programming language R. Its purpose is to facilitate the development of web applications, which allow a user to interact with R code using User Interface (UI) elements in a web browser, such as sliders, drop-down menus, and so forth. In the lesson, you will design and implement a simple application, consisting of a slider which allows a user to select a date range, which will then trigger some code in R, and display a set of corresponding points on an interactive map.

Graphical User Interfaces (GUI) and interactive elements can help to make certain types of data-driven scholarly work more accessible or readable. To give a simple example, historians working with large-scale data might want to demonstrate the change in a variable over time. An interactive map with an adjustable timeline is, in some cases, easier to read and allows for more granularity than a series of static maps. Allowing a user to set the parameters of the visualisation can help to avoid some of the bias often found in data visualisations using time series (for example, arbitrarily drawing one map per decade).

Learning outcomes

After completing this lesson, you will be able to:

  • Create a basic interactive Shiny application
  • Understand the key layouts and design principles of the Shiny UI
  • Use Shiny’s ‘reactive programming’ to ‘listen’ for certain inputs, and understand how they are connected to outputs displayed in your app
Interested in learning more?

Check out this lesson on Programming Historian's website

Go to this resource

Cite as

Yann Ryan, Amanda Regan and Nicole Lemire Garlic (2022). Making an Interactive Web Application with R and Shiny. Version 1.0.0. Edited by Alex Wermer-Colan. ProgHist Ltd. [Training module]. https://doi.org/10.46430/phen0105

Reuse conditions

Resources hosted on DARIAH-Campus are subjects to the DARIAH-Campus Training Materials Reuse Charter

Full metadata

Title:
Making an Interactive Web Application with R and Shiny
Authors:
Yann Ryan
Domain:
Social Sciences and Humanities
Language:
en
Published to DARIAH-Campus:
5/16/2024
Originally published:
10/19/2022
Content type:
Training module
Licence:
CCBY 4.0
Sources:
Programming Historian
Topics:
Data visualisation
Version:
1.0.0