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.
By the end of this module, you should be able to:
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:
R can help analyse the supermarket's sales records and provide answers to these questions.
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:
R can perform these calculations quickly and help present the results in charts and tables.
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:
R can calculate totals, averages, percentages, minimum values, maximum values, and other statistical measurements.
R can work with large collections of information and help analysts identify useful patterns.
R can turn numbers into visual reports such as bar charts, line graphs, histograms, and scatter plots.
Instead of performing calculations manually, you can write instructions that allow R to perform repeated tasks automatically.
R is free to download and use. Its source code is publicly available, and developers around the world contribute packages and improvements.
R is used in different industries to solve problems and understand information.
Schools can use R to analyse examination results, calculate class averages, compare student performance, and identify subjects where students need more support.
Banks and financial analysts can use R to study financial transactions, analyse spending patterns, and support risk analysis.
Researchers can use R to study medical data, examine health trends, and analyse the results of research studies.
Businesses can use R to understand customer behaviour, measure sales performance, compare products, and study marketing campaigns.
Researchers and government organisations can use R to analyse population information, employment figures, education statistics, and economic trends.
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.
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:
You will learn how to use some of these packages in later modules.
Different professionals use R to work with information and solve problems.
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.
Learning R can help you develop skills that are useful in several technology and research careers.
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.
In this module, you learned that:
Imagine you are helping a school in Ibadan understand its students' examination results.
The school has collected the following scores:
| Student | Score |
|---|---|
| Ade | 75 |
| Chika | 85 |
| Tunde | 60 |
| Fatima | 90 |
| Emeka | 70 |
Answer these questions:
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!