R
2019 R-Medicine Conference Day 1
Shipping up to Boston!

R Markdown for Medicine
Attended a workshop by Alison Hill. Here are some of my notes to future self to play with later.
- Figure Labeling automatically
- distill package
- html_document2 yaml output
- xaringan
- posterdown
- stargazer
- table making
- different themes (berlin, roma)
- project management
- flexdashboard
- redoc
- spelling
- wordcountaddin
- htmlwidgets for R
- leaflet
- gitlab
- DataTables
- revealjs
Figure out how to…
- Bookdown: how to combine multiple .Rmd into a “book”
- Make a powerpoint presenation from Rmarkdown (my work is heavy in ppt)
Best practices
- Project
- Use here package
- Have a folder for figures to print to and save
Healthcare Specific R Packages
- qicharts
- qcc
- comorbidity
Make a table in Rmarkdown
| Column 1 left justify | Column 2 centered | Columne 3 right justified |
|---|---|---|
| A | B | C |
Holy cow, that worked on the first try!
Pets not Livestock
Alison Horst advised us that if our figures are more like pets than livestock, we should name them!!!
Here’s my attempt to name some figures and link them throughout the document.
R code
library(tidyverse)
R messages
Warning: package 'tidyverse' was built under R version 4.4.3
R messages
Warning: package 'ggplot2' was built under R version 4.4.3
R messages
Warning: package 'dplyr' was built under R version 4.4.3
R messages
Warning: package 'stringr' was built under R version 4.4.3
R messages
Warning: package 'forcats' was built under R version 4.4.3
R messages
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.2
✔ ggplot2 3.5.2 ✔ tibble 3.2.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.0.4
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
R code
bar_graph_mtcars <- ggplot(mtcars, aes(x = drv)) + geom_bar()

