Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Introduction to R for Data Analysis ยท Lesson 2 of 9

Module One

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
2

Module 1: Introduction to R for Data Analysis

Module Introduction

Have you ever wondered how companies know which products customers buy most, how schools calculate students' performance, or how hospitals study health information?

They use data analysis to understand information and make better decisions. One of the tools used by data analysts is a programming language called R.

In this module, you will learn what R is, why it is important, where it is used, and how it helps people understand data. You do not need to know how to program before starting this course.

Learning Objectives

By the end of this module, you should be able to:

  • Explain what R programming is.
  • Understand the purpose of R in data analysis.
  • Identify the major uses of R.
  • Understand why data analysts use R.
  • Compare R with Excel and other data analysis tools.
  • Identify career opportunities where R is useful.

1. What Is R Programming?

R is a programming language used for working with data. It helps people organise information, perform calculations, create charts, and discover useful patterns.

Think of R as a smart calculator that can do much more than ordinary addition and subtraction. It can analyse thousands or even millions of records when used with suitable computer resources.

For example, imagine a supermarket in Ibadan that sells rice, beans, bread, milk, and cooking oil. The owner wants to know:

  • Which product sells the most?
  • How much money does the supermarket make every month?
  • Which branch has the highest sales?
  • Which products are becoming less popular?

R can help analyse the supermarket's sales records and provide answers to these questions.

2. Understanding Data Analysis

Before learning more about R, you need to understand data analysis.

Data analysis is the process of collecting, organising, examining, and interpreting information to answer questions and make better decisions.

For example, imagine a teacher has the examination scores of 20 students. The teacher can analyse the scores to find:

  • The student with the highest score.
  • The student with the lowest score.
  • The average score of the class.
  • The number of students who passed.

R can perform these calculations quickly and help present the results in charts and tables.

3. Why Is R Important in Data Analysis?

R is popular because it provides many tools for analysing information. It is especially useful for statistics, research, and data visualisation.

Here are some reasons people use R:

A. It Helps Perform Calculations

R can calculate totals, averages, percentages, minimum values, maximum values, and other statistical measurements.

B. It Helps Analyse Large Datasets

R can work with large collections of information and help analysts identify useful patterns.

C. It Creates Charts and Graphs

R can turn numbers into visual reports such as bar charts, line graphs, histograms, and scatter plots.

D. It Saves Time

Instead of performing calculations manually, you can write instructions that allow R to perform repeated tasks automatically.

E. It Is Free and Open Source

R is free to download and use. Its source code is publicly available, and developers around the world contribute packages and improvements.

4. Real-Life Uses of R

R is used in different industries to solve problems and understand information.

A. Education

Schools can use R to analyse examination results, calculate class averages, compare student performance, and identify subjects where students need more support.

B. Banking and Finance

Banks and financial analysts can use R to study financial transactions, analyse spending patterns, and support risk analysis.

C. Healthcare

Researchers can use R to study medical data, examine health trends, and analyse the results of research studies.

D. Business and Marketing

Businesses can use R to understand customer behaviour, measure sales performance, compare products, and study marketing campaigns.

E. Government and Research

Researchers and government organisations can use R to analyse population information, employment figures, education statistics, and economic trends.

5. Comparing R with Excel

Excel and R are both useful tools for data analysis, but they work in different ways.

Feature Microsoft Excel R Programming
How it works Uses spreadsheets, formulas, and built-in tools. Uses programming commands and functions.
Calculations Performs calculations with formulas and functions. Performs calculations using code.
Data Analysis Useful for everyday and business data analysis. Powerful for statistical analysis and research.
Visualisation Creates charts and graphs. Creates many types of charts using packages.
Automation Supports automation through tools such as VBA. Supports automation through reusable scripts.
Cost Usually requires a Microsoft 365 or Office licence. Free and open source.

Remember: You do not have to choose between Excel and R. Many data analysts use both tools because they can work well together.

6. What Are R Packages?

An R package is a collection of additional tools and functions that gives R more abilities.

Think about a mobile phone. It comes with basic features, but you can install applications to perform additional tasks. R packages work in a similar way.

Some popular R packages include:

  • ggplot2: Used to create attractive charts and graphs.
  • dplyr: Used to filter, organise, and transform data.
  • tidyr: Helps organise messy datasets into a useful structure.
  • readr: Helps import and read data files such as CSV files.
  • readxl: Helps import Excel spreadsheets into R.

You will learn how to use some of these packages in later modules.

7. Who Uses R?

Different professionals use R to work with information and solve problems.

  • Data Analysts: Use R to examine datasets and prepare reports.
  • Data Scientists: Use R for statistical analysis, modelling, and data exploration.
  • Researchers: Use R to analyse information collected during research.
  • Business Analysts: Use R to understand business performance and trends.
  • Statisticians: Use R to perform statistical calculations and interpret results.

8. Your First Look at R Code

R uses simple commands to perform different tasks. You will learn how to install R and write commands in the next module.

Here is a small example of an R command:

print("Hello, World!")

This command tells R to display the words Hello, World! on the screen.

Here is another example:

10 + 20

R will calculate the answer and display:

[1] 30

You can also calculate the average of examination scores:

scores <- c(70, 80, 90, 60, 100)

mean(scores)

Result: 80

Do not worry if these commands look unfamiliar. You will learn how to write and understand them step by step.

9. Career Opportunities in R Programming

Learning R can help you develop skills that are useful in several technology and research careers.

  • Data Analyst
  • Data Scientist
  • Business Intelligence Analyst
  • Research Analyst
  • Statistical Analyst
  • Market Research Analyst

R is one of several tools used in data-related careers. Combining it with Excel, SQL, statistics, and data visualisation can help you develop stronger professional skills.

10. Module Summary

In this module, you learned that:

  • R is a programming language used for data analysis and statistics.
  • Data analysis helps people understand information and make decisions.
  • R can perform calculations, analyse datasets, and create charts.
  • R is used in education, healthcare, banking, business, and research.
  • R is free and open source.
  • R packages provide additional tools for different analysis tasks.
  • Learning R can support a career in data analysis and related fields.

Practical Activity

Imagine you are helping a school in Ibadan understand its students' examination results.

The school has collected the following scores:

Student Score
Ade75
Chika85
Tunde60
Fatima90
Emeka70

Answer these questions:

  1. What is R programming?
  2. What is data analysis?
  3. Give three reasons why R is useful.
  4. Name three industries where R is used.
  5. What is an R package?
  6. What is the difference between R and Excel?
  7. Which R package is commonly used for creating charts?

What Is Next?

In Module 2, you will learn how to install R and RStudio on your computer. You will also explore the RStudio interface, understand the Console and Script Editor, and write your first R program.

Keep learning and practising. Every data analyst starts somewhere!

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’