Appendix A — Computing setup

Topics: R, R Studio, Markdown, R Markdown, Quarto, git, Github, Tidyverse packages for R


This course relies on computing resources. Install all the software as indicated on your local machine.

If you already have the software installed, take this opportunity to update to the latest versions.

A.1 The R programming language

  1. Download and install R. Update to the latest version.

R is a programming language that is especially well-suited to statistical computing. It is one of the most popular and widely-used languages for data science, second only to Python.

A.2 The R Studio integrated development environment

  1. Download and install R Studio. Update to the latest version.

R Studio is an integrated development environment (IDE) – a workspace for coding and generating documents. R Studio is specifically designed for coding in R, although it can also be used to code in many other languages. It offers a variety of utilities to enhance the experience of coding and generating documents.

A.3 The Tidyverse packages for R

  1. Install the Tidyverse packages for R. From the Console tab in R Studio (or from R running in a Terminal window), enter:
install.packages("tidyverse")

Alternatively, you may install packages via the Packages tab in the R Studio development environment.

The capabilities of R can be extended by installing additional code packages that have been contributed by members of the R open-source community. Tidyverse is a collection of packages that extend the capabilities of R for doing data science. It includes a number of extremely useful utilities for cleaning, organizing, and presenting data, and performing a range of analytic tasks.

Optional: To learn how to wrangle and visualize data using the Tidyverse packages, you may find it useful to go through the Tidyverse Fundamentals with R modules on Datacamp. Datacamp also offers a range of other learning modules for developing data science skills in R.

A.4 Git and Github for version control

  1. First watch this short YouTube video to get an orientation to git and Github: Git and GitHub for an Organized Project (STAT 545 Episode 2-A) from the University of British Columbia.
  2. Follow these instructions to download and install git and to link git with R Studio.

Reference: Happy Git and GitHub for the useR

Git is software for version control. Git helps you make sure that you never unintentionally delete versions of older files that you actually need.

Github is a web service that leverages git to provide remote storage and access to files. The setup of git + Github greatly facilitates collaboration between multiple individuals working on the same code base.

Then install git on your machine and link it to your R Studio instance and your file repository on Github:

A collection of files associated with a single project is in git-speak called a “repository” or “repo”. You should already have a basic repo set up for you on the course site on Github. The next step is to copy (“clone”) this remote repo to your local machine.

  • Clone your course repo on Github to a new R Studio project on your local machine.
    • Navigate to the course website on Github. Select your repo.

    • Click on the green button labeled “Code”. Copy the URL.

    • In the R Studio window, from the pull-down menu in the upper-right corner, select New Project..., Version Control, Git. Paste the URL into the dialog box labeled Repository URL.

    • Optional: Change the name of the project folder, and the location of this folder on your local directory tree.

    • Click on Create Project. The files from your remote repo should be copied to your local machine in a new folder with the name you chose.

Optional: Download and install the Github desktop client, or an alternative GUI client.

  • The git operations you need for this course can be managed within R Studio, from the Git tab. Some more advanced operations require using either a Terminal window, or a Git desktop client.

As you get going, you will likely want to learn more about how to work with git and Github. Review the documentation for git and this Github Guide. Learn the basics.

A.4.1 Using personal tokens to access Github

Github is phasing out the use of passwords for authorizations.

---- Forwarded Message -----
From: GitHub <noreply@github.com>
To: Arthur Small <asmall@virginia.edu>
Sent: Sunday, February 21, 2021, 6:20:58 AM EST
Subject: [GitHub] Deprecation Notice

Hi @arthursmalliii,

You recently used a password to access the repository at uva-eng-time-series-sp21/coronato-nicholas with git using git/2.30.0.

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.

Thanks,
The GitHub Team

Instead, you must create a personal access token. See the Github documentation.

A.5 Quarto

Quarto is an example of a markup language: a set of formatting instructions for rendering documents. Quarto is special in that it allows for embedding chunks of computer code (in R, Python, and several other languages) that can be executed at the time the document is rendered. This is remarkable, and powerful.

In this course, we will write our work in Quarto within the R Studio environment. Files written in Quarto can then be rendered as HTML files (e.g., web pages), PDF documents, presentations in PowerPoint and other formats, or even as MS-Word documents.

Quarto is based on predecessors called Markdown and R Markdown. For a nice introduction to Markdown and R Markdown, watch the short YouTube video Reproducible Reports with R Markdown (STAT 545 Episode 3-A) from the University of British Columbia.

As you proceed in creating your documents, you will probably want to access additional resources:

  • From within R Studio, you can access an R Markdown Cheat Sheet via Help/Cheatsheets.

  • Markdown reference: https://www.markdownguide.org/

  • R Markdown reference: https://rmarkdown.rstudio.com/

A.6 Bibliographic resources: Zotero and Bibtex

A bit later in the course, we will show how to incorporate citations into your documents.

  1. Install Zotero.
    • Recommended: Also install the Zotero plug-in for your preferred web browser.

A.7 General course web resources