Skip to main content Start main content

'IT Support for Research' Workshop: Basic R

Workshop/ Training/ Webinar

20211007-event-Basic-R
  • Date

    07 - 26 Oct 2021

  • Organiser

    ITS

  • Time

    14:30 - 17:00

  • Venue

    Online and On-site  

Summary

R is a programming language and an environment for statistical computing and graphics. This workshop, consists of five sessions, aims at introducing R for beginners and preparing for learning R at intermediate level.

The Basic R workshop covers all fundamental R knowledge, such as data types, basic string operations, basic operators, data structure, functions and etc.

All students are welcome to join.

'IT Support for Research' Workshop: Basic R

Target Audience: RPg, TPg and Ug students

Pre-requisite: Basic programming concepts

Medium of Instruction: English

Course Outline:

Lesson 1

1. Introduction to R

  • What is R & Why R
  • Compare R vs Python
  • IDE tools for R with Anaconda
    • Anaconda
    • Rstudio
    • R command line
    • Help document of R
    • Command for Workspace
  • Modules & Packages
    • Module and packages
    • Demonstration on package installation
    • Variable & R-Object
  • Variables & Data Types
    • Variable and assignment
    • Data type and conversion
  • Basic String Operations
    • Paste function
    • Format function
    • Strsplit function
    • Substr function
    • Nchar function
    • Toupper/ Tolower function
  • Basic Operators
    • Athematic operators
    • Relational operators
    • Logical operators
    • Assignment Operators

 

Lesson 2

1. Data Structure

  • Vectors
  • Lists
  • Matrices
  • Arrays
  • Factors
  • Data Frames
  • Accessing element in data structure

2. Decision making

  • If else statement
  • Switch statement

3. Loops

  • For Loop
  • While Loop
  • Repeat Loop

4. Functions

 

Lesson 3

1. Load/Save Data in R

  • Load/save CSV/ Excel/ SQLite database in R
  • Install rjson package
  • Load the package required to read JSON files
  • Convert JSON file to a data frame

2. Managing Data Frame

  • Adding on to data frames
  • Adding attributes to data frames
  • Subsetting data frames

3. Data Cleaning

  • Prepare and import the data set
  • Understanding the data set
  • Impute missing values
  • Find and correct invalid data
  • Remove duplication records


Lesson 4

1. Data Integration

  • Append data from another tables
  • Manage columns with data in dataframe
  • Merge data by common keys

2. Data Transformation

  • Data Aggregation
  • Normalization
    • Min-max normalization
  • Standardization
    • Z-score standardization
    • Unit conversion
  • Transform a continuous variable into a categorical variable and vice-versa
    • Conversion of a continuous variable to categorical variable
      • Data binning using R Base function cut
    • Conversion of a categorical variable to numerical variable
      • One-hot encoding

Lesson 5

1. Data Visualization with ggplot

  • Selecting the right chart type
  • Visualization using GGPLOT2 to gain insight and get an overview of dataset. Demonstrate specific type of datasets and design the code for below 8 charts:
    • Comparison
    • Line charts
    • Bar Charts
    • Distribution
    • Histograms
    • Boxplots
    • Composition
    • Pie charts
    • Stacked column charts
    • Relationship
    • Scatter plots
    • Heatmap

Your browser is not the latest version. If you continue to browse our website, Some pages may not function properly.

You are recommended to upgrade to a newer version or switch to a different browser. A list of the web browsers that we support can be found here