SISBID 2025
https://github.com/dicook/SISBID
A dashboard is a rmarkdown
format shiny
app. It adds more control over plot elements and is more focused on the data analysis than on a study or instructional materials.
A dashboard
Make sure you have the flexdashboard
package installed on your computer.
Knit
---
title: "TB incidence around the globe"
author: "by Di Cook"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
This creates a box or a pane for a plot or results
This sets up columns
A new page (tab) can be added using
Page 1
=====================================
Add a second page to your flexdashboard that focuses on one country and has
A set of notes with interactive plots, quizzes, and coding exercises.
learnr
interactive tutorial🛑 To get started, make sure you have the learnr
package installed on your computer.
install.packages("learnr")
✅ Then create a new “R Markdown” document, “From Template”, “Interactive Tutorial”.
🛑 Check that the document compiles, by clicking Run Document
✅ Modify the title and author
🛑 Check that the document compiles, by clicking Run Document
✅ Set the first section to be a description of the data
🛑 Check that the document compiles, by clicking Run Document
✅ Create a data
directory in your tutorial folder, and add the TB_burden_countries_2025-07-22.csv
data into this.
✅ Next, add a block of R code to read the data, and display the data in the page.
Here, we use the DT
package to display the data in the output html.
🛑 Check that the document compiles, by clicking Run Document
✅ Make a separate section titled “Incidence”, and add the code to make a plot, like the following
🛑 Check that the document compiles, by clicking Run Document
Loading the libraries generates some messages and warnings on the page.
This is good interactively, but distracting in the finished page.
## ── Attaching packages ──────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.2.0 ✔ purrr 0.3.2
## ✔ tibble 2.1.3 ✔ dplyr 0.8.3
...
## Google's Terms of Service: https://cloud.google.com/maps-platform/terms/.
## Please cite ggmap if you use it! See citation("ggmap") for details.
## Warning: Removed 619 rows containing missing values (geom_point).
We need to change the setup chunk options to turn these off:
🛑 Check that the document compiles, by clicking Run Document
An example quiz is provided in the template. Note that the format of the R code is
quiz()
wraps a set of questions.question()
contains the text of the question, and is coupled with multiple answer()
elements with possible choices., correct = TRUE
. There can be more than one correct answer.Adding exercise = TRUE
on a code chunk provides an R console window where readers can type R code, and check for correctness.
🛑 Check that the document compiles, by clicking Run Document
Because this is an html document, interactive graphics can be incorporated.
We’ll add a section to use interactive plots to examine the temporal trend in TB incidence.
🛑 Check that the document compiles, by clicking Run Document
Use your emoji and anicon skills to add some friendly elements to the notes.
🛑 Check that the document compiles, by clicking Run Document
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.