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
R
is the programming language we use for most of our analysis. InstallR
on a mac or from https://mirror.rcg.sfu.ca/mirror/CRAN/.
6.3 Rstudio
RStudio
is the commonly used IDE (Integrated Development Environment) for R. DownloadR studio
from https://posit.co/downloads/. Please do not installRStudio
withHomebrew
as we ran into issues in the past.
6.4 Git
- What the heck is
Git
?!Git
is a version control system that lets you manage and keep track of your source code history. InstallGit
withHomebrew
if you are on a mac (if on Windows or Linux follow this link here).
6.5 Github
Github
is a cloud-based hosting service that lets you manageGit
repositories. Create aGithub
account using yournewgraphenvironment.com
email and we will invite you to our repos. More onGithub
lingo in subsequent dedicated sections.
6.6 Rstudio Integration with Git and Github
- To setup
Rstudio
andGit
following these instructions https://happygitwithr.com/rstudio-git-github. They play well together. Usedevtools
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 restartingR
using theshift+command+0
keyboard shortcut they will be available in allRstudio
sessions.