The workshop includes a number of hands-on exercises so you’ll need a laptop or desktop computer (Mac or Windows are both fine). As described below, you can either install RStudio Desktop and a bunch of packages, or run RStudio in a browser using the Posit Cloud platform. A second monitor is also strongly recommended (see more below).
RStudio Desktop is not a terribly big or computationally intensive program, however if your laptop is old and slow, consider using the Posit Cloud service.
A good way to complete the workshop exercises is to use Posit Cloud. Posit Cloud is a virtual environment that allows you to run R in a browser. If you use Posit Cloud for the workshop, you won’t have to install any software or data, because the instructor will prepare a virtual machine image that you can ‘clone’. It functions nearly identical to RStudio Desktop, and works pretty well as long as you have reasonably good internet connection. Using Posit Cloud requires setting up an account (free).
To use Posit Cloud for the workshop, login to your account and then click on this link:
https://posit.cloud/content/8521414
This will open a RStudio project within Posit Cloud with all the required packages, exercises, and data ready to go. After the project opens, click the ‘Save a Permanent Copy’ button in the toolbar, which will make a copy of the project in your own workspace.
Alternately, you can install R and RStudio Desktop on your own computer. R is cross-platform, so Windows, Mac, or Linux should all work. R and RStudio Desktop are not large programs, but you should have at least 1-2Gb of free HD space (if your laptop is not sufficient consider using the Posit Cloud option instead). Please install R, RStudio, and a number of packages as described below.
1. Download and Install R (64-bit):
Note: If you already have R installed, please make sure you have version 4.0 or later. If needed, you can update R by downloading the latest version from CRAN and (re)installing it.
2. Download and Install RStudio Desktop
Download and install RStudio Desktop for your operating system. The free version is fine.
https://posit.co/download/rstudio-desktop/
3. Install Packages
R packages are like add-ons - they expand the capabilities of R. To install the packages for the workshop, run the following lines of code in RStudio (You can click the little copy button in the green text box below, then open RStudio and paste the commands into the console and hit enter). An internet connection is required.
## Required packages
pkgs_req <- c("sf", "tidyverse", "conflicted", "leaflet",
"tmap", "tmaptools", "leaflet", "remotes",
"palmerpenguins", "ggspatial", "patchwork",
"scales", "here", "rappdirs", "kableExtra",
"knitr", "tigris", "tidycensus", "crsuggest",
"arcgislayers", "areal", "usethis")
## See which ones are missing
(pkgs_missing <- pkgs_req[!(pkgs_req %in% installed.packages()[,"Package"])])
## Install missing ones
if (length(pkgs_missing)) install.packages(pkgs_missing)
## Re-run the check for missing packages
pkgs_missing <- pkgs_req[!(pkgs_req %in% installed.packages()[,"Package"])]
if (length(pkgs_missing)==0) cat("ALL PACKAGES WERE INSTALLED SUCCESSFULLY \n")
##########################################
## TIPS
##
## If you are prompted by the question, 'Do you want to install from sources the
## package which needs compilation?', select 'No'.
##
## If you get an error message that a package can't be installed because
## it's already loaded and can't be stopped, restart R (Session >> Restart R),
## and try again.
##
##########################################
4. Download the Workshop Materials
The workshop slides, exercise notebooks, and data are all on GitHub. You can download them to your computer by running:
usethis::use_course("https://ucdavis.box.com/shared/static/o83wxyxhqf3vybh2bisexmdra7iufnjt.zip")
Alternately, you can go to the GitHub Repo and click the green ‘Code’ button. Remember to unzip the file to your hard drive in a location of your choice. Double-click the dfd2024.Rproj file to open the workshop materials in RStudio.
Note that the slides and exercises may be updated after the workshop. If you’d like to keep a copy of the workshop materials for posterity, plan on downloading it again a week or two after the final session.
Slides will be added to the course website before each session. The slides will be in HTML format, so you can follow-along in your browser, or view them as the instructor presents them on Zoom.
Exercises will be in Quarto notebooks, that you’ll have to open in RStudio and complete. When you’re done with an exercise, be sure to click the ‘Render’ button to save a copy of your work as HTML. If you’re doing the exercises on Posit Cloud, you can download the HTML file to your laptop using the ‘More > Export’ button in the files pane. More info and links will be provided during the workshop.