Getting all the necessary software installed, configured, and playing nicely together is half the battle when first adopting an open source, reproducable scientific workflow. These steps have become increasingly easier over the years and we are here to help you if you hit a hurdle đ
Welcome to Geography 13, Introduction to Spatial Data Science In this course we will use R and RStudio for data organization and manipulation, analysis, and communication/visualization. Youâll learn more about both throughout the course.
Since this class is online, you will need to use your own laptop (or to set up a free RStudio Server Account). If you can, it is preferable to have the software on your own system.
The step-by-step document will help you get R & RStudio on your own computer, along with several tools weâll be using through out the quarter. If you have problems, you can contact me, or a TA.
If you have an older versions of R/RStudio installed, we recommend updating. You can check what version of R you are running by typing version
in the console of RStudio.
version
_
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 0.1
year 2020
month 06
day 06
svn rev 78648
language R
version.string R version 4.0.1 (2020-06-06)
nickname See Things Now
And you can check what version of RStudio you are running by going to âHelp â> About RStudioâ
If you donât have at least R 4.0.XXX and RStudio 1.4.XXX. Proceed with this document.
R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing. The R language is widely used for developing statistical software and data analysis. R also provides unparalleled opportunities for analyzing spatial data for spatial modeling.
RStudio is an integrated development environment (IDE) for R. Combined the R language and RStudio IDE provide the open-source, free, toolset for this course.
Download the latest release (âR-version.pkgâ) of R and save the .pkg file. Double-click it to open, and follow the installation instructions. Note that there are different version in you have an Intel chip (e.g. R-4.1.0.pkg) or an Apple M1 chip (e.g. R-4.1.0-arm64.pkg)
Now that R is installed, you can download and install RStudio.
Download the latest R installer (.exe) for Windows. Install the downloaded file as any other windows app. Now that R is installed, you can download and install RStudio.
Now that R is installed, you can download and install RStudio.
Once both R and RStudio are installed, you can find and click on the RStudio icon to open the program. The RStudio icon looks like this:
Opening RStudio will launch a workplace. If something like the below image appears for you, then you are all set!
We will spend the quarter working in this IDE so the layout and features will become clear as we go. A few things to note now are:
Your layout and theme may not look like the above (all the elements are the same but arranged differently). If you want to change your theme and layout got to RStudio â> Preferences.
Here you can adjust the âAppearanceâ and âPane Layoutâ. If you want your to look like mine, see below:
R comes loaded with many base packages and tools. There are also many additional tools that will make your life easier. Throughout this class, weâll use packages that exist in the aggregate tidyverse
package.
The tidyverse
contains a collection of very useful packages that play nicely together for data exploration, manipulation, wrangling and visualization (among other things). Packages can be installed from CRAN (Comprehensive R Archive Network) using the following pattern which should be typed in the console (yellow box):
install.packages("tidyverse")
After you press âEnter,â you should see a whole bunch of text streaming across the Console Window. This is a good sign and is simply logging whatâs being downloaded/installed. This process can go on for a few minutes (the tidyverse has a lot of different components). You will know itâs done when the active cursor shows up again waiting for your next command.
Once itâs installed, you can ensure that everything worked by loading/attaching the tidyverse
using the library call:
library(tidyverse)
When you press enter, some information will come up below the command. Donât worry too much about it now as long as there are no errors!
If you got something similar to the above youâve successfully installed R, RStudio, and the tidyverse package. Congratulations!
Ok, with everything you just learned your assignment is to install three new packages: rmarkdown
, remotes
, gapminder
.
Once you do that, clear the console by clicking the broom icon () and run the following 3 lines of code:
Sys.getenv("LOGNAME")
$major
version
RStudio.Version()$version
c("tidyverse", "rmarkdown", 'remotes', 'gapminder') %in% rownames(installed.packages())
For exercise 1, submit a screenshot of the output to the relevant Gauchospace dropbox. It should look like this:
The key, is to make sure the version of R is correct (4); the version of RStudio is correct (1.4.XXXX) and your packages are installed (four TRUE values).
You can close RStudio (you donât need to âSave the Workspaceâ or anything else when prompted).
Nice work!