Skip to content
R introduction
R?
Rstudio user interface
Script editor and console
Environment
Files tab: setting the working directory
Packages tab: installing packages
Help tab: getting help
Basic syntax in R
Basic syntax
Comparisons in R
Logical operators
Logical operations
Combine logical operations
Creating variables
Create variables by assigning a value
Variables
Create variables by running a function
Running functions
Using multiple functions after each other
Functions with the same name from different packages
Vectors
Create a vector
How to create vectors?
Retrieve elements from a vector
How to retrieve elements?
Change or remove elements from a vector
How to remove and change elements?
Logical and arithmetic operations on variables
Logical operation on a vector
Factors
Order of levels
Matrices
Retrieving elements from a matrix
Data frames
Create a data frame
Retrieve elements from a data frame
How to retrieve elements from a data frame?
Remove columns from a data frame
How to change elements in a data frame?
Add and reorder columns in a data frame
Lists
Operations on variables
Mathematical functions for vectors and tables
Mathematical functions
Functions for tables: names of rows/columns and merging
Functions on tables
Functions that work on text
Functions that work on factors
Sort versus order
Functions that return indices
Functions that return indices
Functions to check and change the type of variables
Type of variable?
Functions for handling missing values
How to remove missing values?
Operations on rows of tables are hard
Calculate descriptive statistics
Calculate descriptive statistics
Descriptive statistics
apply() as a substitute for for-loops in R
apply
Reading and writing files
Define the file you want to read
The read functions
Reading files
Arguments of the read functions
Reading compressed files
Writing files
Get your data in the right format
How to make a formula for dcast()?
Conditional statements
How does ifelse() work?
Make graphs with ggplot2
Define what you want to plot
How to make a plot with 2 factors?
Define what you want to plot for a plot with 2 factors
The philosophy behind ggplot2
Plot statistics with stat_summary()
How to plot bars that represent a mean?
Why factor() is important in plots
Plot the data with geoms
Arguments to set colors, shapes, line types, position…
Position on a plot
Plots with points: scatter, bubble, hexbin and beeswarm plots
Scatter plots
Beeswarm plots
Plots with bars and points
Plot distributions: histogram, QQ, box, violin and ridge plots
Histograms
Box plots
Violin plots
Adding lines to a plot
Adding text labels to a plot
Add text labels
Adding titles to a plot
Scales define what the axes and the legend look like
Scales
Themes define all remaining characteristics of a plot
Save plots
Regression
Adding regression lines to a plot
Doing the regression yourself
Regression lines
Combine multiple plots on a graph
Facets: multiple plots of the same type on one graph
patchwork: combining plots and tables on one graph
ggpubr: alternative package to combine plots and tables
Multiple plots on a graph
Make graphs with other packages
Heat maps
Heat maps
Heat maps with ggplot2
Heat maps with pheatmap
Heat maps with pheatmap
Doing the clustering yourself
Exercise 35A: heat map for RNASeq data
Line plot with ggplot2: prep
Line plot with ggplot2
Line plot with ggplot2: the code
Visualize a phylogenetic tree with ggtree
PCA plots
PCA plots
PCA plots with ggfortify
Exercise 35B: PCA plot for RNASeq data
Plotly for 3D plots and interactive plots
Venn diagrams
Venn diagrams
Statistical analyses
Checking assumptions of parametric tests
Checking assmptions of parametric tests
Comparing two groups
Comparing two groups
lm() for comparing groups
lm() for comparing groups
Checking normality of residuals
Checking normality of residuals
Multiple tests, one per row
Multiple tests, one per row
Add p-values to a plot
Add p-values to a plot
Exercise 37: Comparison of 2 groups
One way ANOVA
One way ANOVA
Pairwise comparisons of groups after one way ANOVA
Post hoc tests after ANOVA
Kruskal Wallis: non parametric counterpart of one way ANOVA
Kruskal Wallis test
Two way ANOVA
Two way ANOVA: check main effects
Two main ANOVA: check main effects
Two way ANOVA: interaction
Two way ANOVA: check interaction
Two way ANOVA: pairwise comparisons
The use of lm() for modeling
Other functions for modeling and comparing groups
Comparisons of unranked categorical data
Comparison of unranked categorical data
Randomness in R
Correlation
Correlation
Survival analysis
Survival analysis
1 of 2
vib-logo
Previous Topic
Next Topic

Files tab: setting the working directory

  1. R introduction
  2. Rstudio user interface
  3. Files tab: setting the working directory

Previous Topic
Back to Lesson
Next Topic
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT