Condensed R: 240-Minute R Tutorial¶
Goal¶
This tutorial is designed for learners with little to no programming or R experience and prepares them to learn more about R on their own. We’ll introduce some of the most useful features of R for the analysis of biological data.
Note
This tutorial was prepared for presentation with an experienced R instructor. Self-guided learners should also find this tutorial useful.
- Tutorial home
- Introduction
- R and RStudio basics
- Understanding basic R functions
- Fundamental objects in R
- Creating objects in R
- Naming objects in R
- Reassigning object names or deleting objects
- Understanding object data types (modes)
- Mathematical and functional operations on objects
- Vectors
- Creating and subsetting vectors
- Adding to, removing, or replacing values in existing vectors
- Logical Subsetting
- The magic of programming
- A few final vector tricks
- Importing data and working with data frames
- Working with spreadsheets (tabular data)
- Importing tabular data into R
- Summarizing and determining the structure of a data frame
- Introducing Factors
- Subsetting data frames
- Coercing values in data frames
- StringsAsFactors = FALSE
- Data frame bonus material: math, sorting, renaming
- Saving your data frame to a file
- Importing data from Excel
- Data cleaning with Tidyverse dplyr
- Visualization basics
- Getting help with R
Prerequisites¶
Downloads, access, and services¶
In order to complete this tutorial you will need access to the following services/software
Prerequisite | Preparation/Notes | Link/Download |
---|---|---|
CyVerse account | We will use CyVerse VICE to complete this tutorial. This will eliminate the time consuming step of having each learner install R on their own. | CyVerse User Portal |
[Optional] Install R | If not using the CyVerse VICE app, you will need to install R on your own computer. You can follow instructions at this link to install R on your own computer. | Project R |
[Optional] RStudio | If not using the CyVerse VICE app, you will need to install RStudio on your own computer. You can follow instructions at this link to install RStudio on your own computer. (Choose the free “RStudio Desktop”) | RStudio |
Platform(s)¶
We will use the following CyVerse platform(s):
Platform | Interface | Link | Platform Documentation | Quick Start |
---|---|---|---|---|
Data Store | GUI/Command line | Data Store | Data Store Manual | Data Store Guide |
Discovery Environment | Web/Point-and-click | Discovery Environment | DE Manual | Discovery Environment Guide |
Application(s) used¶
Discovery Environment App(s):
App name | Version | Description |
---|---|---|
rstudio-3.5.0 | 3.5.0 | RStudio |
Credits and attributions¶
Material for this tutorial is credited to the Data Carpentry Genomics R lessons (https://datacarpentry.org/genomics-r-intro/index.html) As well as materials from Jeff Holister’s R Tutorial (http://usepa.github.io/introR/2015/01/14/03-Clean/)
Fix or improve this documentation
- Search for an answer: CyVerse Learning Center
- Ask us for help: click on the lower right-hand side of the page
- Report an issue or submit a change: Github Repo Link
- Send feedback: Tutorials@CyVerse.org