Question
  • What packages do I need to install in order to attend the SIH’s Machine Learning with R course?
Objectives
  • To install all the packages so we can hit the ground running on day 1

Installation instructions

if (getRversion() < 3.6){
  stop("You need R >= 3.6 to attend the workshop. Please update R!")
}

list_of_pkgs <- c(
  "AmesHousing",
  "tidyverse",
  "tidymodels",
  "doParallel",
  "vip",
  "ggcorrplot",
  "naniar",
  "parallelly",
  "GGally",
  "mlbench",
  "usemodels",
  "qs",
  "ranger",
  "skimr",
  "bestNormalize",
  "plotly"
  )

au_repo <- "https://mirror.aarnet.edu.au/pub/CRAN/"

#install installr and rtools if windows
if (.Platform$OS.type == "windows"){
  install.packages(c("installr"), repos = au_repo)
  installr::install.Rtools(choose_version = F,
                           check = T,
                           GUI = T)
  win_only <- c("installr")
} else {
  win_only <- c()
}

# run the following line of code to install the packages you currently do not have
new_pkgs <- list_of_pkgs[!(list_of_pkgs %in% installed.packages()[,"Package"])]
if(length(new_pkgs)) install.packages(new_pkgs,repos = au_repo)

# install helper function to plot metrics
list_of_pkgs <- c(list_of_pkgs,
                  win_only)

#check everything is installed and write out an error message if it ain't.
missing_pkg <- list_of_pkgs[!(list_of_pkgs %in% installed.packages()[,"Package"])]
if(length(missing_pkg)) {
  print("=======================================================")
  print("Packages which didn't install properly:")
  print(missing_pkg)
  print("Try to install them again or ask a helper for assistance.")
  print("=======================================================")
} else {
  print("=======================================================")
  print("All packages installed properly! :)")
  print("=======================================================")
}
[1] "======================================================="
[1] "All packages installed properly! :)"
[1] "======================================================="
To do before the workshop begins
  • Please join the workshop with a computer that has the following installed (all available for free):
  • Please copy and paste the code above in your Rstudio, run it and if there are any errors please let us know via email (sih.training@sydney.edu.au) BEFORE the workshop begins