New computer setup
What needs to be installed and/or setup when there is a new computer or a new member wants to set up things on their own computer.
Most of the computers in the lab have macOS so the instructions are currently for MacOS only. Once the need arises, the instructions for Windows/Linux will be added.
Before we start
Homebrew
Most of the installations in these instructions are done using the homebrew package manager for macOS/Linux (primarily macOS). A few notes about this:
R should be installed using the installer from their website. Do not install it using homebrew. That's what is recommended by the R project (https://mac.r-project.org/tools/) and hopefully will lead to fewer errors when building packages from source which sometimes happens when you simply want to install a package or do
renv::restore()
. Note: if you prefer to use rig (a utility that allows you to install different versions of R in parallel and switch between them; see https://github.com/r-lib/rig), that should be fine because rig downloads R binaries from r-project.org.Before installing a GUI program (R Studio, Visual Studio Code, SourceTree, Slack, etc.) using
brew install --cask <name-of-the-program>
check that it hasn't been installed yet by searching for it using Spotlight. In most cases, there shouldn't be a problem if you re-install a program using homebrew but let's not test this assumption.If you don't want to install GUI programs with homebrew and would rather download installers from the programs' website - go for it.
We do recommend using
homebrew
for any CLI programs (git, mambaforge/conda, GitHub CLI, etc.).homebrew
will make sure that they are added to PATH and have a higher priority than
Change default terminal shell to bash
The reason we prefer bash is because it is the most commonly used shell and so when you google an error the instructions are particular to bash and won't work in zsh (the default macOS shell).
Run in a terminal:
Once done, close the terminal.
Someone with admin rights (might be the user)
I don't actually know whether admin rights are necessary for all of these.
Install homebrew that will help us install other programs without admin rights.
The web page linked above has a command prominently featured on it. Copy it, paste it into a terminal, and hit Enter.
The script will ask you for your password and to agree to something a few times. That's to be expected. Give it the password, agree to everything.
At the very end, it will tell you to "[r]un these two commands in your terminal to add Homebrew to your PATH" followed by two lines of terminal commands. Copy both of those lines starting with a parenthesis and closing with a double quote, paste them into the same terminal, and run them.
Install R. There are two versions: arm64 and x86. Click on the Apple logo in the top left corner and then on "About this Mac". Look at the line where it says what chip you have: if it says "M1"/"M2"/"M3" - install arm64 R, if it says "intel" - install the other one.
Install RStudio:
brew install --cask rstudio
User
Install Google Chrome (if not already installed)
Install blabr
In an R console (open RStudio or run R
in the terminal)
Python (and conda):
Close and re-open the terminal. There should be (base)
prepended to the prompt line now.
blabpy
All things git
brew install git
Even though MacOS comes with git preinstalled, it comes with an outdated version.brew install gh
- GitHub CLI tools that make authenticating on GitHub easier.Set up GitHub. (skip on shared computers)
Install SourceTree:
brew install --cask sourcetree
Building R packages (even if you aren't planning to develop R packages).
Follow instructions at https://mac.r-project.org/tools/ to install "Mandatory tools".
Note: the xcode-select
part might tell you that the command line tools have already been installed - that's alright, skip to the next step.
Other software
Install Slack:
brew install --cask slack
Install VS Code as code/text editor and tell git to use it:
brew install --cask visual-studio-code
git config --global core.editor "code --wait"
Install ELAN 6.3 from the page with the previous versions. Use the
M1.dmg
link if you have an M1/M2/M3 processor and the.dmg
one if you have Intel. Do not install the latest version! We have had bad experience (bugs, slow speed) with the versions newer than 6.3. It is possible that the very latest version has all of that fixed but until we've tested that, please stick to 6.3.
Adjust finder settings
View -> Show Path Bar. The path to the current folder should appear at the bottom of the window.
Finder > Settings, then click Advanced. Select “Show all filename extensions.”
Suggestions
Install iTerm2 - replacement for the built-in terminal.
Install R package
renv
and use it to have per-project R environments with their own independent sets of packages and R versions.Install rig (https://github.com/r-lib/rig) to switch between R versions.
To work with Python, get a JetBrains license (free for students and researchers) and install PyCharm. Also, consider using DataSpell for mixed R/Python workflow and just as a more lightweight alternative.
Get a GitHub Education account (free for students and researchers), sign in in PyCharm/DataSpell and install GitHub Copilot
Install quarto - RMarkdown reincarnation from RStudio developers.
Install kdiff3 and set it up as git difftool and mergetool. Alternative, use git tools within PyCharm/DataSpell.
TODO
Consider other software choices for:
Git visual diff and merge. kdiff3 is just something Zhenya was used to. There must be something that doesn't feel so dated.
Last updated