Guide

This guide documents features of R, RStudio, Posit Cloud, and Quarto, which are relevant throughout the course. These can settings that need to be made or tips that we communicate during the live sessions.

If you have a request, let us know and we will add guidance here.

1 Switch pipe operator

By default, R uses %>% as the pipe operator from the magrittr package. Since R 4.1.0, the pipe operator is also available as |> without loading any packages. The |> operator is recommended to be used instead of %>%.

To switch to the native pipe operator, follow these steps:

  1. Open your project on Posit Cloud
  2. On the menu bar of RStudio, click on Tools > Global Options... (see Figure 1)
  3. On the left panel, click on Code
  4. On the right panel, select the 4th check-box from the top next to ’Use native pipe operator, |> (requires R 4.1+) (see Figure 2)
  5. Click on Apply and OK
Figure 1: RStudio Global Options
Figure 2: RStudio Code Options

2 Zotero reference management

We recommend using Zotero as a tool for reference management, but do not teach how to use it in this course. The guidance below will support you in setting up Zotero.

2.1 Get Zotero account

  1. Open https://www.zotero.org/user/login/
  2. Click on Register for a free account
  3. Chose username, email, and password
  4. Click Register
  5. Open your email and verify your account

2.2 Install Zotero desktop client

  1. Open https://www.zotero.org/download/
  2. Download Zotero for your operating system
  3. Install Zotero
  4. Log in to your Zotero account by opening Settings -> Sync and typing the Username and Password you have previously set up
  5. Click on the green refresh button in the top-right corner of the Zotero window

2.3 Install the Zotero Connector for your browser

  1. Open https://www.zotero.org/download/
  2. Download the Zotero Connector for your browser
  3. Install the Zotero Connector
  4. Log in to your Zotero account

2.4 Setup Add-ons and the citation key format

  1. Go to https://retorque.re/zotero-better-bibtex/installation/
  2. Click on the latest release so you are redirected to github
  3. Find the .xpi file and right-click it. Click on Save Link As… and choose your location for saving the file.

  1. Open Zotero -> Tools -> Add-ons -> (Gear icon) -> Install Add-on From File… -> choose the .xpi file you have just saved

  1. Restart Zotero

  1. Wait until the database fully loads. Only the first time is long; the next interactions with Zotero will be much faster.

  2. You may need to restart Zotero the second time. Please do so if you see a prompt after Better BibTeX is installed.

  3. Go to Zotero -> Settings -> Export -> Default Format and change the default format to Better BibTeX Quick Copy:

  1. In the same setting window, go to Better BibTeX -> Open Better BibTeX preferences…

  1. In the Citation keys tab, use the following Citation key formula for Better BibTeX: [auth:lower][year][veryshorttitle1_0:lower]

The line above means that the citation key will be build from:

  • First author’s last name in lowercase
  • publication year
  • The first word from the title in lowercase, not including the connectors such as “the” or “a”

  1. Go to Export -> Quick-Copy in the Better BibTeX preferences. Select Pandoc citation.

2.5 Change the setting for the citekey autopin delay

  1. Open Zotero advanced preferences (Zotero -> Settings -> Advanced)
  2. Open the Config Editor under the Advanced Configuration section

  1. Click I accept the risk!
  2. In the search bar, search for autopin

  1. Double-click into the field under Value
  2. In the new window called Enter integer value, change the existing 0 to 2

  1. Click OK
  2. Close all setting windows

3 Publish to GitHub Pages

3.2 Make repo public

If your repository’s visibility is set to “private” (indicated by a small padlock next to the repositories name), you first need to switch it to “public” by following these steps:

  1. Click on “Settings”.

  1. Stay on “General” and scroll down to the bottom of the page “Danger Zone”.

  1. On the first sub-heading “Change repository visibility”, click “Change visibility”, then “Change to public”.

  1. Click “I want to make this repository public”.

  1. Click “I have read and understand these effects”.
  2. Click “Make this repository public”.
  3. Provide the requested credentials.
  4. Done.

3.3 Publish with GitHub Pages

  1. Open your capstone project repository, and click on “Settings”.

  1. In the left navigation pane, click on “Pages” under “Code and automation”.

  1. Under “Build and deployment”, then under Branch, click the dropdown titled “None”.

  1. In the dropdown, select “main”.

  1. Click on the dropdown titled “/ (root)”. In the dropdown, select “/docs”.

  1. Click “Save”.

3.4 Edit “About” of repository

  1. Open your capstone project repository.

  1. On right side, next to “About”, click on the gear icon.

  1. Under “Description” you can add “This project report was prepared for the data science for openwashdata course.” or anything else that you would like to highlight.

  1. Under “Website”, click “User your GitHub Pages website”.

  1. Under “Include in the home page”, you can remove the checked boxes.

  2. Click “Save changes”.

  3. The public URL of your repository will now be shown under “About” on the right side.

  1. Open your published website and enjoy.