Basic R Programming
Basic R Programming is a course in R, the free open-source language for statistics and graphics, from installing R with RStudio or Positron to wrangling data with the tidyverse, running basic statistical tests, building charts with ggplot2 and producing reports with Quarto. It suits IT staff, students, researchers and anyone comfortable with a computer who wants to start analysing data in R.
- Duration18 hours · 3 days
- FormatOnsite / live online
- Next roundOn request
- CertificateIncluded
Course overview
R is a free, open-source programming language and environment for statistical computing and graphics. It offers a wide range of statistical functions and a growing library of community packages on CRAN, which makes it a core tool for researchers, statisticians and data analysts. Writing R is now much easier thanks to IDEs such as RStudio and Positron, the readable tidyverse packages, and Quarto, which combines code, charts and explanation into a single report.
This course takes learners from the very start of R: installing R and choosing an IDE, variables, data types, vectors and data frames, installing packages, and importing data from CSV, Excel and databases. Learners then write conditions, loops and their own functions, wrangle data with dplyr and tidyr, handle dates, calculate descriptive statistics and run hypothesis tests, build charts with base graphics and ggplot2, and finish by producing a data analysis report with Quarto.
What you’ll gain
- Install and use R with RStudio or Positron in an organised way
- Use R variables, data types and core data structures
- Import data from files and databases into R and wrangle it with dplyr and tidyr
- Write conditions, loops and your own functions
- Calculate descriptive statistics and run basic hypothesis tests
- Build charts with base graphics and ggplot2, and produce reports with Quarto
Who this course is for
- Anyone who wants to start analysing data with R
- IT staff and officers who produce statistical reports from organisational data
- School and university students and researchers who use statistics in their studies or research
- Excel users who want a tool that repeats analysis automatically
Prerequisites
- Able to use a computer and manage files and folders
- No previous programming experience is needed
- Basic statistics knowledge, such as means and standard deviations, helps you learn faster
- A Windows or macOS laptop with permission to install software
Curriculum
Course Details
This course is the 2026 edition of Basic R Programming, rewritten for R 4.6 and the current RStudio and Positron IDEs. It runs for 3 days, 6 hours per day (18 hours in total, 09:00-16:00), as lectures with a lab in every topic. Beginner level. Day one installs the tools and covers variables, data structures, packages and importing data. Day two covers conditions, loops, functions and data wrangling with dplyr, tidyr and lubridate. Day three covers statistics, hypothesis testing, charts with base graphics and ggplot2, and reporting with Quarto. The course focuses on R programming foundations; learners who want to go on to data mining can continue with the institute's R data mining course. Learners take home the scripts and datasets for every lab.
Day 1 Getting Started with R and Importing Data
Section 1: Lab: Getting to Know R and Its Tools
- What R is, its strengths and limits, and CRAN
- Installing R and choosing between RStudio and Positron as your IDE
- The console, scripts, the environment and getting help
- Creating a project to organise files without setwd()
- Lab: install the tools and run your first R script
Section 2: Lab: Variables, Data Types and Vectors
- Assigning values with <- and naming conventions
- The numeric, integer, character, logical and factor types
- Creating vectors and vectorised calculation
- Missing values (NA) and how calculations handle them
- Lab: calculate sales, tax and discounts for many products at once
Section 3: Lab: Data Structures
- Matrices, lists, data frames and tibbles
- Selecting data with [ ], [[ ]] and $
- Filtering rows and selecting columns with conditions
- Inspecting data with str(), head() and summary()
- Lab: build and explore an employee data frame
Section 4: Lab: Packages and Project Management
- Finding and installing CRAN packages with install.packages()
- Loading packages with library() and getting to know the tidyverse
- Reading package documentation and vignettes
- renv for locking package versions per project
- Lab: set up a project that reproduces on another computer with renv
Section 5: Lab: Importing and Exporting Data
- The example datasets that ship with R
- Reading CSV files with readr and Excel files with readxl
- Handling Thai text and UTF-8 encoding
- Connecting to databases with DBI and odbc
- Lab: combine sales data from CSV and Excel and save it as a new file
Day 2 Programming and Data Wrangling
Section 6: Lab: Control Flow
- Truth testing and comparison operators
- if, else and if_else for whole columns
- for and while loops
- When to use vectorised code or the apply family instead of loops
- Lab: grade student scores and count each grade
Section 7: Lab: Writing Your Own Functions
- Creating functions, parameters and default values
- Return values and variable scope
- Handling errors with stop(), warning() and tryCatch()
- Documenting functions so they are easy to reuse
- Lab: a summary statistics function that works on any numeric column
Section 8: Lab: Data Wrangling with dplyr
- The native pipe (|>) for readable step-by-step code
- filter, select, mutate and arrange
- summarise, and grouping with .by or group_by
- Combining tables with left_join and inner_join
- Lab: summarise sales by branch and product category
Section 9: Lab: Reshaping Data with tidyr and Text
- The idea of tidy data
- pivot_longer and pivot_wider
- Splitting and combining columns, and handling missing values
- Cleaning text with stringr
- Lab: turn a cross-tab report from Excel into analysis-ready data
Section 10: Lab: Dates and Times
- The Date and POSIXct classes in R
- Parsing text into dates with lubridate
- The Asia/Bangkok time zone and converting Buddhist and Gregorian years
- Summarising data by day, month and quarter
- Lab: analyse monthly sales from dates in several formats
Day 3 Statistics, Charts and Reports
Section 11: Lab: Descriptive Statistics
- Mean, median, standard deviation and quartiles
- Summarising continuous and categorical data
- Frequency tables and cross-tabulations
- Grouped summary statistics with dplyr
- Lab: summarise a customer satisfaction survey
Section 12: Lab: Inferential Statistics
- Correlation between two variables with cor.test()
- t-tests and their non-parametric equivalents
- Chi-squared tests for categorical variables
- Testing distributions and power analysis
- Lab: test whether sales at two branches differ significantly
Section 13: Lab: Charts with Base Graphics
- plot, hist, barplot, boxplot and dotchart
- Adding titles, axis labels, labels and legends
- Placing several charts on one page
- Exporting charts to PNG and PDF
- Lab: a quick set of exploratory charts
Section 14: Lab: Charts with ggplot2
- The grammar of graphics: data, aesthetics and geoms
- Building charts layer by layer with ggplot()
- Facets for comparing several groups
- Adjusting themes, colours and labels, and saving with ggsave()
- Lab: report-ready sales trend charts by region
Section 15: Workshop: A Data Analysis Report with Quarto
- Creating a Quarto document that combines code, output, charts and text
- Rendering the report to HTML and Word
- Workshop: analyse a real dataset from import to conclusions
- Making sure the report re-runs when the data changes
- Present the work and discuss next steps in data science
Schedule & training options
For individuals — public rounds
No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770
For organisations — in-house / private
- Tailor the content to your team’s tools and projects
- Your dates, at your office or live online
- Quotation with tax ID for procurement
Instructors
Frequently asked questions
How do you load data from a CSV file into R?
Use read_csv() from the readr package, for example sales <- read_csv("data/sales.csv"), or the built-in read.csv(). The data is stored as a table (a data frame or tibble). Then check it with head() to see the first rows, str() or glimpse() to see each column's data type, and summary() for summary statistics. Keep files inside an RStudio or Positron project and use relative paths rather than setwd().
How do you install and load a package in R?
Install it once with install.packages("name"), which downloads it from CRAN to your computer. Then, every time you start a new R session, load it with library(name) before using its functions. To see what a package offers, use help(package = "name"), or type ? before a function name for its documentation. If a project must use the same package versions on every computer, use renv.
When should you use a t-test rather than a chi-squared test?
A t-test compares the means of continuous data between two groups, such as average sales at two branches, using t.test() in R, with wilcox.test() as an alternative when the data is not normally distributed. A chi-squared test checks whether two categorical variables are related, such as gender and product choice, using a contingency table with chisq.test(). In both cases a p-value below 0.05 is usually taken as a significant difference or association.
Who is the Basic R Programming course for, and what should I know beforehand?
It suits IT staff, students, researchers, Excel users and anyone who wants to start analysing data and making charts with R. No programming experience is needed; you just need to be comfortable using a computer, as the course starts with installing R and an IDE. Some basic statistics knowledge will help you learn faster.
What will I be able to do after the Basic R Programming course?
You will be able to install R and an IDE, organise projects and packages, write and run scripts, work with variables and data structures, import data from CSV, Excel and databases, write conditions, loops and your own functions, wrangle data with dplyr and tidyr, calculate descriptive statistics, test hypotheses with t-tests and chi-squared tests, build charts with ggplot2 and produce reports with Quarto. Participants receive a Certificate of Completion.
What software do I need for Basic R Programming?
You need R 4.6, downloaded free from CRAN, and a free IDE such as RStudio Desktop or Positron; either works, as the R code is the same. You also install packages such as tidyverse, readxl and renv from CRAN, and Quarto for reports. Everything runs on both Windows and macOS.

