Emory IBS 519 Guest Lectures: Fall 2023
{:.no_toc}
by Melinda Higgins, PhD; https://melindahiggins.netlify.app/
- TOC 1 {:toc}
Week 1 Lecture: Intro to R, RStudio and Rmarkdown
This class will cover:
- Explore RStudio environment
- command line
- R scripts
- packages
- getting help
- RStudio Education
- R markdown intro (brief)
- Importing & viewing data
- abalone dataset
str()
,dim()
,head()
,tail()
functions
- Data types - classes of variables
- strings
- integers
- numeric
- logical
- factors (brief intro)
Materials
- RStudio Cloud Project "IBS_519_wk1_lecture02_mhiggins"
- three R scripts
- and simple Rmarkdown report to get started
- stored on Github
- Optional: Intro to R and RStudio
- Getting Started with Packages
- Optional: Introduction to R Objects
- Optional: R Objects - Brief Overview of Factors
- Optional: Intro to ggplot2 (i.e. week 2)
- Optional:
Week 3 Lecture: Data Exploration and Wrangling (with dplyr)
This class will cover:
- Data exploration
- numerical exploration
summary()
functiondescribe()
function fromHmisc
packagedescribe()
function frompysch
package
- graphical exploration
- histograms
- scatterplots
- learn more at:
- numerical exploration
- more with the
abalone
dataset - Tidyverse -
dyplr
package- glimpse
- select
- filter (explore and clean)
- arrange
- mutate (making new variables)
- rename
- summarise
- group_by
Materials
- RStudio Cloud Project - in class exercises
- see "IBS_519_wk3_lecture06_mhiggins" on RStudio.cloud
- also see Github repository
- RStudio Cloud Project - Homework 3
- see "Assignment3_HW3_DataWrangling_Cleaning" on RStudio.cloud
- also see Github repository
Week 4 Lecture: Reproducible Research and RMarkdown
Today's class will cover:
-
Make your life easier with Rmarkdown
-
Writing a step-by-step analysis report
- make DOCX and HTML reports (PDF optional)
-
Using parameters - automate your work - learn more at:
-
Making other "Rmarkdown" formats
- see Rmarkdown Galley
- Documents (HTML, DOC and PDF - see notes below)
- Slides (HTML slidy and ioslides; PDF Beamer; and Microsoft Powerpoint PPT)
- and other templates - see RMarkdown Gallery to learn more
-
more on making PDF documents:
- PDF requires some version of LaTeX - easiest is installing the
tinytex
package- see https://yihui.org/tinytex/
- after installing the
tinytex
package, you still have to runtinytex::install_tinytex()
to actually install the tinytex program with all of the LaTeX packages. - Learn more about LaTeX at:
- PDF requires some version of LaTeX - easiest is installing the
Materials for wk4
RStudio Cloud Project "IBS_519_wk4_lecture08_mhiggins" - files explained:
This project is also posted in Github at https://github.com/melindahiggins2000/IBS_519_wk4_lecture08_mhiggins
Main Examples Today:
Files:
- 01_Basic_RmarkdownReport.Rmd
- 02_Default_RmarkdownTemplate.Rmd
- make reports (HTML, DOCX and PDF)
- make slides (slidy, ioslides, beamer and PPT)
- 03_AbaloneReport_simple.Rmd
- 04_AbaloneReport_paramTemplate.Rmd
- 05_AbaloneReport_paramInYAML.Rmd
- 06_AbaloneReport_param_UserInput.Rmd
Packages used in main examples today:
tidyverse
(includesreadr
,dplyr
,ggplot2
)knitr
printr
rmarkdown
purrr
gtsummary
IF TIME - optional demos:
Files:
- rmdformats_readthedown.Rmd
- flexdashboard.Rmd
- EDA_tools.Rmd
Packages needed:
- For EDA_tools.Rmd
skimr
summarytools
- For rmdformats_readthedown.Rmd
rmdformats
- For flexdashboard.Rmd
flexdashboard
Follow-up from wk3
- review the
order_sort_arrange.R
scipt
More resources:
R/RStudio Helpful Resources
-
- This is where you can download the R language software for FREE for your own computer.
- Choose your operating system (Mac OS or Windows or Linux/Unix)
- NOTE: For Windows, you should also download and install Rtools - this is technically optional, but is useful to have. Make sure to download the one for your R version.
-
- Note: Windows is listed at the top - just scroll down to see the installer for the Mac OS as well. There are also installers for the versions of Linux/Unix.
-
Reproducible Templates for Analysis and Dissemination - My Coursera Course