6 Software Setup

6.1 Homebrew

For those on an Apple computer, Homebrew is a package installer for MacOS that can simplify the install and management of packages (example Git). To download homebrew follow the instructions at https://brew.sh/ . Once Homebrew is installed, just paste brew install git into your terminal to install Git, easy! Many packages can be installed with homebrew (using scripts too) and you can see a list of examples here https://github.com/NewGraphEnvironment/dotfiles/blob/master/brew.sh .

6.2 R

  1. R is the programming language we use for most of our analysis. Install R on a mac or from https://mirror.rcg.sfu.ca/mirror/CRAN/.

6.3 Rstudio

  1. RStudio is the commonly used IDE (Integrated Development Environment) for R. Download R studio from https://posit.co/downloads/. Please do not install RStudio with Homebrew as we ran into issues in the past.

6.4 Git

  1. What the heck is Git ?! Git is a version control system that lets you manage and keep track of your source code history. Install Git with Homebrew if you are on a mac (if on Windows or Linux follow this link here).

6.5 Github

  1. Github is a cloud-based hosting service that lets you manage Git repositories. Create a Github account using your newgraphenvironment.com email and we will invite you to our repos. More on Github lingo in subsequent dedicated sections.

6.6 Rstudio Integration with Git and Github

  1. To setup Rstudio and Git following these instructions https://happygitwithr.com/rstudio-git-github. They play well together. Use devtools package whenever possible.

6.6.1 Verified commits

When possible - we use verified commits on Github. Details on how to set them up can be found at https://docs.github.com/en/authentication/managing-commit-signature-verification.

# 4.  Get setup with `wsl` and `posgresql`. I put my notes from long ago [here](https://github.com/NewGraphEnvironment/pg_wsl) . I was using rstudio-server to run scripts like those in `bcdata` and `bcfishpass` through the terminal. Have a look [here](https://github.com/NewGraphEnvironment/dotfiles/blob/master/install_geo.sh) for some insights into getting postgres set up and tuned.

6.7 Private info

There are a couple ways we store and share private info when using the above tools. They include environmental variables, public and private keys, and passwords. Here is our current set up:

6.7.1 Environmental variables

Environmental variables are variables that are not shared through communications between computers and servers such as passwords or API keys. For example, we use environmental variables to store passwords and settings we use to access remote Postgres databases.

One way to set up environmental variables is within Rstudio. These variables do not persist outside of Rstudio sessions (ex. when running command line programs) but are easy to set up and see:

  • Use usethis::edit_r_environ() to open the .Renviron file in the root of your project. This file is used to store environmental variables that are specific to your project.

  • Once we have shared environmental variables with you, copy/paste them into the .Renviron file. After restarting R using the shift+command+0 keyboard shortcut they will be available in all Rstudio sessions.