Can't install jpeg when trying to run swirl course

I'm very new to RStudio and have been working through swirl courses to get familiarized but I've run into an issue with installing jpeg in order to complete the Exploratory Data Analysis course.
Here is the error I receive:

| Trying to install package ‘jpeg’ now...
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘jpeg’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘jpeg’

Warning in install.packages :
installation of package ‘jpeg’ had non-zero exit status

| Could not install package ‘jpeg’!
seq.default(0, 1, length.out = nrow(e$les)) :
argument 'length.out' must be of length 1

Any help is much appreciated