## Pre-req: R and RStudio
## Download R:
# Windows: https://cran.r-project.org/bin/windows/base/
# Mac: https://cran.r-project.org/bin/macosx/
# Win/Mac: https://www.rstudio.com/products/rstudio/download/#download
## Download RStudio Desktop:
# https://rstudio.com/products/rstudio/download/#download
## After R and RStudio are installed, then:
# 1. start RStudio
# 2. copy/paste the code below into the console window (bottom-left window)
# 3. press [Enter].
# This script will install the required packages for R.
# Install all CRAN packages
package_list <-
c(
# ADA1
"tidyverse"
, "openintro"
, "remotes"
, "GGally"
, "Hmisc"
, "MASS"
, "car"
, "emmeans"
, "gt"
, "knitr"
, "multcomp"
, "multcompView"
, "nortest"
, "pwr"
, "quarto"
, "rgl"
, "scales"
, "scatterplot3d"
, "vcd"
# ADA2
, "mvnormtest"
, "labelled"
, "gridExtra"
, "cluster"
, "caret"
, "candisc"
, "aod"
, "ROCR"
, "NbClust"
, "klaR"
)
## Install the list of CRAN packages
install.packages(package_list, dependencies = TRUE, type = "binary")
# This may ask you for a CRAN repository.
# In pop-up box, scroll to bottom to choose one in USA.
# Say No to question: "install from sources the package which needs compilation?"
# Install github packages
## Install Erik's package from github
remotes::install_github("erikerhardt/erikmisc")
remotes::install_github("erikerhardt/erikdata") # ADA2
# For erikmisc...
# If it asks to update packages (it should not ask this if you updated packages above),
# Press 2 [Enter] for "CRAN packages only".
# If asks about "make" command, click "Cancel".
# If asks about "git" command, click "Cancel".
# Similarly for this package (used in IMS textbook)
remotes::install_github("hrbrmstr/waffle") # ADA1
# and for this package (used in some plots)
remotes::install_github("haleyjeppson/ggmosaic") # ADA1Installing R Packages, ADA1 Fall 2026 and ADA2 Spring 2027
Advanced Data Analysis 1 and 2, Stat 427/527 and Stat 428/528, Prof. Erik Erhardt, UNM
Install packages we’ll use
- This may take a while, so do only once.
Copy and paste this long code chunk into the R Console window and press [Enter]. Each package will be downloaded (along with package dependencies) and installed.