R/Medicine 2024
👋 Hi, I’m Garrick!
🖥️ garrickadenbuie.com
🦬 grrrck@fosstodon.org
3 hours long with two breaks
Break-out small groups for exercises
Video, voice or chat
Questions welcome! Use chat or raise your hand.
*
at the start, I’ll read it out loudhttps://rconsortium.github.io/RMedicine_website/Attend.html
All event participants, whether they are attending an in-person event or a virtual event, are expected to behave in accordance with professional standards, with both this Code of Conduct as well as their respective employer’s policies governing appropriate workplace behavior and applicable laws.
Report issues to me in private chat or during breakout sessions.
Breakout Sessions
Pair Programming
Driver: share your screen, writes code
Navigator: review, guide, look up
Video on encouraged
We’ll shuffle breakout groups each hour
Created by Twitter, Bootstrap is released in 2011.
Joe Cheng unveils Shiny in 2012
Bootstrap releases v3 in August 2013, a complete re-write.
Shiny moves to Bootstrap 3 in October 2014.
Shiny still uses Bootstrap 3.
<div>
<label id="academic_year-label" for="academic_year">Academic Year (start)</label>
<input id="academic_year" type="number" value="2012" min="1996" max="2022" step="1"/>
</div>
<div class="form-group shiny-input-container">
<label class="control-label" id="academic_year-label" for="academic_year">Academic Year (start)</label>
<input id="academic_year" type="number" class="shiny-input-number form-control" value="2012" min="1996" max="2022" step="1"/>
</div>
New and improved Bootstrap 4 and 5
Easy theming in any web output from R
fluidPage(
theme = bslib::bs_theme(
preset = "shiny",
primary = "#0072B2",
success = "#009E73",
base_font = font_google("Inter"),
code_font = font_google("JetBrains Mono")
)
)
bslib rebuilds Bootstrap’s Sass to CSS from scratch
https://collegescorecard.ed.gov/data/
College enrollment, student aid, costs, and student outcomes from 1996-97 through 2022-23.
Two tables:
school
: information about each college
scorecard
: historical data on cost, enrollment, outcomes.
exercises/01_app.R
Are we all set up?
Take a Shiny app and make it bslib-ier
{type}Page()
to page_{type}()
Use the app to learn about the variables in school
Any troubles getting set up?
Questions about bslib or the data set?
snippet shinyapp
library(shiny)
library(bslib)
ui <- page_${1:sidebar}(
${0}
)
server <- function(input, output, session) {
}
shinyApp(ui, server)