Download and install the latest version of R.
Download and install the latest version of RStudio.
There are a couple of useful settings to change in RStudio.
- Tools / Global Options / Workspace: Restore .Rdata at startup = OFF
- Tools / Global Options / Workspace: Save workspace to .Rdate on exit = Never
See Efficient R / Rstudio options for more information.
Windows users: install RTools.
To use spatial packages (eg.:
sf), we need to install some system dependencies. The
sf README has great instructions. Make sure to install these dependencies before trying to install spatial packages.
You may also find it easier to install using the R-universe version of packages, for example:
Quick setup instructions here, but see the chapter on Git for more details.
Check out the great instructions in Happy Git With R. Be sure to check if
git is installed first!
Historically, the lab primarily uses GitLab for private and group projects and GitHub for mirroring published projects or packages. This was largely dictated by GitHub’s lack of free, private repositories, and GitLab’s great continuous integration tools. Nowadays, the line is less clear - GitHub offers free private repositories and GitHub Actions. GitHub is more commonly used, especially in R package development. Take your pick or use both!
- Make an account on GitHub or GitLab (or both), and message Alec your usernames.
- Setup global git user name and email. See here.
- Setup a local folder on your computer to store all of your git repositories. I use a folder called ‘Local-git’ under Documents (
You can alternatively clone your repositories to different places on your hard drive, but I find it more straightforward to keep everything together.
You may opt to use a git client to work with git on a regular basis. Again, see a great discussion in the Happy Git With R book here. We’ve tried using cross platform clients in the past to make it easy for folks to help each other. Recently, it has been GitAhead - but development on it has recently halted… Next step TBD.