Skip to contents

A Google search for the question “where should I start learning R?” will return a deluge of websites, tutorials, YouTube videos and blog posts. These results probably aren’t incorrect, but they’re not likely to list any of the important practices and habits new R users should adopt when beginning their R journey.

gerp was written to help guide new users towards a set of ‘good enough’ practices that have been shown to help “you get more done in less time and with less pain.”(1) New R users often struggle needlessly before discovering these practices because they’re scattered across multiple textbooks and online documentation (with some excellent exceptions (2).

Adopting at least a few of these practices will increase your productivity when you’re using R (or any other programming language!).

Outline

This vignette will go over how to install and load the gerp package, and how to get started with a new gerp R project.

Practice (prăk′tĭs)

To do or perform habitually or customarily; make a habit of

One of the first practices we’re going to cover is installing and loading packages. R packages are a collection of functions, data, and documentation bundled in a standardized format. R packages are a vital part of the R ecosystem and provide users with a wide range of data analysis, visualization, and modeling tools. Understanding where and how to access them is essential to your early success.

Install a package

R is an open-source programming language, so anyone can create an R package. These packages are typically shared with other R users through online repositories like the Comprehensive R Archive Network (CRAN) or GitHub.

Enter the code below in your R console to download the most recent version of gerp from GitHub:

install.packages("remotes")
remotes::install_github("mjfrigaard/gerp")

Load a package

After gerp is installed, load the package using the library() function

Quick start

If you’d like to get up and running with a new gerp project quickly, you can enter the following code in your RStudio Console pane (in a fresh RStudio session)

gerp::ger_proj()

You’ll see the following:


new gerp project on Windows

new gerp project on Windows


gerp::ger_proj() will default to the your Desktop folder (or some other conspicuous place). It’s unlikely you’ll want your project named, ‘new_project’. I’ll demonstrate how to change the name of a new gerp project on macOS below:


Close the RStudio project:


Close gerp project

Close gerp project


Navigate the the new_project folder (it should be in your Desktop folder) and give it a new name:


Rename gerp project folder

Rename gerp project folder


You’ll also need to rename the .Rproj file (inside your project folder)


Rename gerp project file

Rename gerp project file


To re-open my project, I navigate to the .Rproj file and double-click on it to open RStudio.


Rename gerp project file

Rename gerp project file


  1. Good enough practices in scientific computing. Wilson G, Bryan J, Cranston K, Kitzes J, Nederbragt L, et al. (2017) PLOS Computational Biology 13(6): e1005510. https://doi.org/10.1371/journal.pcbi.1005510

  2. What They Forgot to Teach You About R. Jennifer Bryan, Jim Hester