3.1 Introduction

R is a programming language designed for statistical computing and graphics (R Core Team 2026). It is widely used in business intelligence, data science, and academic research because of its powerful data manipulation capabilities, extensive package ecosystem, and strong support for statistical modeling and visualization. RStudio is an integrated development environment (IDE) that provides a user-friendly interface for writing, running, and debugging R code (Posit team 2025).

For students new to programming, R has a steeper initial learning curve than GUI-based BI tools like Power BI or Tableau. However, this investment pays dividends: coding gives you precise control over every step of your analysis, makes your work reproducible, and builds skills that transfer across tools and platforms. As we discussed in Chapter 1, AI coding assistants are now making this learning curve less steep — but they do not eliminate the need to understand what your code does.

This chapter is organized as a hands-on introduction. We begin with the practical setup — accessing RStudio through Posit.Cloud or installing it locally — then work through the building blocks of R programming: commands, functions, variables, data structures, packages, and programming constructs. The chapter concludes with an introduction to AI tools that can assist your R programming workflow. For installation instructions for R, RStudio, and Claude Code on your own computer, see the Appendix.