Basic R Programming Tutorial

badge

R is a powerful programming language and software environment widely used for statistical analysis, data visualization, and machine learning. It provides a vast array of tools and libraries that make it a popular choice among data scientists, statisticians, and researchers.

R excels in statistical analysis and is equipped with a rich set of functions for descriptive statistics, hypothesis testing, regression analysis, time series analysis, and multivariate techniques. This makes it a preferred choice for researchers and analysts working with data from various fields, such as social sciences, finance, healthcare, and environmental studies.

Moreover, R offers exceptional data visualization capabilities. Its default plotting system allows users to create a wide variety of static and interactive visualizations to explore and present data effectively. Additionally, packages like ggplot2 provide a grammar of graphics approach, enabling users to construct complex and customizable plots with ease.

In recent years, R has gained popularity in the field of machine learning. Packages such as caret, randomForest, and keras offer powerful tools for building and evaluating predictive models. R's integration with other languages, such as Python, allows users to leverage popular machine learning frameworks like TensorFlow and scikit-learn within their R workflow.


Before Starting

  1. Download and install both R and RStudio: https://posit.co/download/rstudio-desktop/
  2. This tutorial uses R markdown files. Kindly refer to this video on how to work with R markdown files on RStudio: https://www.youtube.com/watch?v=DNS7i2m4sB0
  3. Download this file (phages.tsv), and place it inside the same folder as the R markdown files that you will be creating in this tutorial.

Topic Outline

If you want to directly open and run the code on RStudio, refer to the R Markdown column.

But, if you only want to view the contents of a tutorial (without having to download and open it on RStudio), refer to the HTML column.


Topic R Markdown HTML
1 Introduction to R Syntax Link Link
2 Groups of Data: Vectors, Matrices & Lists Link Link
3 Data Frames Link Link
4 Manipulating Data with dplyr Link Link
5 Fundamentals of Data Visualization with ggplot2 Link Link
6 Descriptive Statistics Link Link
7 Inferential Statistics Link Link

References

This tutorial references the following resources:

The dataset we use in this tutorial was downloaded using INPHARED last September 2022:


Authors

These materials were originally created for the Basic R Workshop, jointly organized by the Bioinformatics Lab (College of Computer Studies) and the Systems and Computational Biology Unit (College of Science), De La Salle University, last July 12, 2023.