Overview: Why R?

overview of perks R offers

Whether you’re looking to start coding for a new career or just as a hobby, choosing your first programming language can be a daunting task. There is no one-size-fits-all answer—it depends on the type of project you’ll work on, what is demanded on the job, etc. However, R stands out with several appealing benefits.

Chances are, sooner or later, you'll encounter R, one of the most popular (if not the) statistical programming languages worldwide. R's popularity isn't just because it's free; it's also due to the global community that uses, documents, and continually improves it.

Warning

The R interface might seem intimidating at first, especially if you're used to using Excel to do your data magic. But trust us, investing time in learning R will pay off greatly, not just in your grad school career, but also in your industry career. R, alongside Python, has become a standard skill for jobs in marketing analytics and data science.

One of the best things about R is the wide range of learning resources available. However, with so many options, it can be hard to know where to start. This guide offers the right starting point and the resources to help you learn R efficiently, including the following topics:

  • Tips for learning R efficiently
  • Learn advanced R
  • Reproducible workflows in R
  • How to manage R packages
  • Analysis in R: Examples
  • Communicate your insights: Publish e-books and interactive articles directly from R
  • Building webpages with R

    Tip

    Set up R and RStudio

    Your first step is to set up R and RStudio on your local machine, following our R/R Studio installation guide.

Tips for learning R efficiently

Here are a few tips to learn R efficiently:

  • Have a project!

    "Huh - why to have a project? I first need to learn R!"

    Well, if you really want to learn R, you should already have a project in mind that you would like to tackle. R is a powerful tool, and without a clear goal, you might feel overwhelmed. If you don't have a specific project, and still would like to learn R, consider finding an interesting dataset to work with, like those available on Kaggle.com.

  • Enroll in R courses at Datacamp. It is free with a Tilburg University account!

  • Learning your method

    • Once your data is prepped, you can begin analyzing it. The method you choose will depend on your specific research question. For many students, a refresher in regression analysis— such as Ordinary Least Squares (OLS) or Logistic Regression (Logit)—may be particularly useful.

Learn Advanced R

Want to learn more advanced programming with R? Check out the digital version of the book: “Advanced R”, in Chapman & Hall’s R Series.

Mastering Reproducible Workflows with R

Want to learn the essential skills for reproducible research and open science in R? This book covers a wide range of topics such as:

Also, explore the materials from the University of Glasgow's MSc course in Data Skills for Reproducible Science.

Managing R Packages

Packages in R are collections of functions, data, and code bundled together and stored in a ‘library’. While R comes with a standard set of packages, you can install additional ones as needed. As your projects grow, managing packages can become complex. Use this code snippet to automatically install any packages you may need.

For effective package management, consider using Packrat. This tool helps avoid dependency issues by isolating R packages, making them portable, ensuring project reproducibility. This is especially useful when working on multiple projects or across different machines with different versions of packages installed. Learn more in our comprehensive guide to Packrat

Analysis with R: Examples

Got a hang of the R syntax and are looking to put your R coding skills to practice with some empirical project? Here are some guides and code examples for commonly used techniques for descriptive and causal analysis.

Communicate insights with R

One of the most important and challenging jobs of a researcher is communicating one’s findings to non-technical stakeholders in an appealing way. R facilitates creative ways to present your insights through interactive dashboards (R Shiny), and tools like Distill, Bookdown, and Quarto for publishing content (e.g., e-books, slides, articles) directly to the web from R.

Want to try it yourself? Here are some resources to help you get started:

Building Webpages with R

Interested in creating a webpage with R? Check out this guide.

For interactive webpages with R, you can easily create them using webexercises.

Summary

R is a powerful statistical language with extensive resources that make it a top choice for data analysis. This guide helps you get started with R by covering setup, efficient learnign tips, advanced techniques, package management, reproducible research, and methods for communicating your insights.

Continue your journey by learning to code in R following proper coding style guidelines.

Contributed by Roshini Sudhaharan