Director of Biostatistics and Data Core - ONR; Research Professor
View the Project on GitHub melindahiggins2000/RWorkshops_HJFGlobal_AugSept2023
R Training Workshops for HJF Global Infectious Diseases - Given in Aug and Sept 2023
Workshop Instructor:
Table of Contents
arsenal
broom
ggthemes
(optional)ggthemr
(optional)
devtools
package to run the devtools::install_github('Mikata-Project/ggthemr')
command.gmodels
gtsummary
Hmisc
knitr
patchwork
palmerpenguins
plyr
psych
rmarkdown
tidyverse
[includes dplyr
, ggplot2
, tidyr
, readr
, and more…]tinytex
& run the installation - see instructions at https://yihui.org/tinytex/usmap
Times | Materials Covered |
---|---|
08:30-09:45 | Part 1 - Intro to R and RStudio |
- module01_Rscript.R - right click “save as” | |
Part 2 - Working with R Packages | |
09:45-10:00 | Break |
10:00-11:15 | Part 3 - Intro to Visualizations with ggplot2 |
- ggplot_Rscript_01.R | |
- ggplot_Rscript_02.R | |
Part 4 - Intro to Rmarkdown [if time - see materials below] | |
11:15-11:30 | Q&A |
Times | Materials Covered |
---|---|
08:30-09:45 | Part 5 - Data Wrangling with dplyr |
- UPDATED dplyr_Rscript.R | |
- UPDATED dplyr_Rscript_wAnswers.R | |
Part 6 - Clean and Explore Abalones - R Script | |
- Part 6 R Script Answers | |
- abalone_clean.RData | |
- abalone_table.Rmd | |
- abalone_table.html | |
09:45-10:00 | Break |
10:00-11:15 | Part 7 - Merging Data |
- module07_Rscript.R | |
- data1.csv | |
- data2.csv | |
- data3.csv | |
Part 8 - Data Restructuring | |
- module08_Rscript.R | |
- long1.csv | |
- wide1.csv | |
Part 9 - If Time Simple Maps - R script | |
- Dataset hospital_ops.csv | |
- Map Report Simple RMD HTML | |
- Map Report w/Parameters RMD HTML | |
- Map Report w/choice RMD HTML | |
11:15-11:30 | Q&A |
A question was asked about what happens if a data file has text blocks with commas or carriage returns that might cause a problem reading in a delimited file format.
Here is a quick example to illustrate that it does work.
Example Data in CSV and EXCEL formats:
Example R Code to read these files:
See this document illustrating this textwrap example.
Additional R packages to be used today:
Times | Materials Covered |
---|---|
08:30-09:45 | review workshops 1, 2 and textwrap question |
Quick Overview of R Objects | |
R Program - Clean Abalone Data | |
R Program - Performing Statistical Tests | |
09:45-10:00 | Break |
10:00-11:15 | Working with Rmarkdown |
Regression - linear and logistic | |
AbaloneReport_Sept2023.Rmd | |
AbaloneReport_Sept2023.html | |
AbaloneReport_Sept2023.pdf | |
11:15-11:30 | Q&A |
Additional packages for today:
Times | Materials Covered |
---|---|
08:30-09:45 | missingData.R R Script |
09:45-10:00 | Break |
10:00-11:15 | More with Rmarkdown |
Part 9 - If Time Simple Maps - R script | |
- Dataset hospital_ops.csv | |
- Map Report Simple RMD HTML | |
- Map Report w/Parameters RMD HTML | |
- Map Report w/choice RMD HTML | |
11:15-11:30 | Open Discussion and Q&A |
Useful reference on missing data: