Skip to content

Introduction to R for Data Analysis

dataMaster-Kris edited this page Mar 25, 2020 · 30 revisions

Description

The scripting language of R is considered one of the most powerful languages for quantitative analysis, statistics, and graphics. This workshop will help you get started with analyzing your datasets and creating graphs for visualization. We'll do hands-on exercises to demystify data analysis using R. From our previous experience in teaching this workshop, we know that some of the folks register with an expectation to learn how to use ggplot2, seurat, dplyr, etc. but most registrants come absolutely uninitiated. This workshop is designed for those who have no background whatsoever in programming/R. We'll not cover ggplot2, seurat, dplyr, etc. but some of these will be covered in our intermediate-level workshops.

The topics that we'll cover are listed below.

  • RStudio interface.
  • Addition, subtraction, basic math operations.
  • Assigning values to variables.
  • Commenting in a script.
  • Logical operators.
  • Intro to functions and libraries.
  • Reading data.
  • Troubleshooting error messages.
  • Exploring data. (Basic summaries such as mean, median, etc.)
  • Selecting subsets of data.
  • Plotting data.
  • Data structures available in R.

No background in statistics or computing necessary. Bring your laptop with RStudio and R installed.

Learning Path

Novice   This is an introductory workshop in the R Scripting series. No prior experience with programming or R/RStudio is required for this course. No prerequisites. Absolute beginners are especially welcome!

Materials

Click here to download the workshop materials.

Pre-workshop Instructions

Before the workshop, please make sure to install R and RStudio on your laptops.

Online Learning

You can access these materials remotely at any time and go through them at your own pace. Here's how:

  1. Download the materials and unzip the contents.

  2. Inside the downloaded folder is a slide deck that describes some of the essential terms and concepts. Please go through these and practice the commands on the slides in RStudio. Note that direct copying from slides to RStudio may result in errors because of formatting differences.

Additional recommended materials

  1. UCSF library provides an excellent Intro to R module in its Collaborative Learning Environment. It has an instructional video to get started with RStudio, descriptive text, and exercises for practice. All of it is available in a user-friendly online environment. We highly recommend checking this out!

  2. Software carpentry provides well-organized content to get started with R. See here. Absolute beginners may want to focus on modules 1-11 and go through them in two or three sessions.

  3. A searchable list of RStudio webinars and conference talks

  4. Free online book: Hands-on programming with R