
Introduction to R
Preface

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Structure of the book
Chapter Introduction to R gives a quick overview of R and its evolution over the last 2 decades. Chapter Install R & RStudio acts as a guide for installing R and RStudio. Chapters Variables in R and Data Types in R introduce the reader to variables and data types in R. Chapter Getting Help in R shows the right place and right way to ask for help. Chapters Vectors in R to Lists in R introduce the basic data structures in R. Chapter Install & Update R Packages explores the R package system.
Software information
The R session information when compiling this book is shown below:
sessionInfo()R version 4.5.2 (2025-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Matrix products: default
LAPACK version 3.12.1
locale:
[1] LC_COLLATE=English_India.utf8 LC_CTYPE=English_India.utf8
[3] LC_MONETARY=English_India.utf8 LC_NUMERIC=C
[5] LC_TIME=English_India.utf8
time zone: Asia/Calcutta
tzcode source: internal
attached base packages:
[1] stats graphics grDevices datasets utils methods base
loaded via a namespace (and not attached):
[1] compiler_4.5.2 fastmap_1.2.0 cli_3.6.6 htmltools_0.5.9
[5] tools_4.5.2 yaml_2.3.12 rmarkdown_2.32 knitr_1.52
[9] jsonlite_2.0.0 xfun_0.61 digest_0.6.39 rlang_1.3.0
[13] renv_1.2.4 evaluate_1.0.5
We do not add prompts (> and +) to R source code in this book, and we comment out the text output with two hashes ## by default, as you can see from the R session information above. This is for your convenience when you want to copy and run the code (the text output will be ignored since it is commented out). Package names are in bold text (e.g., rmarkdown), and function names are followed by parentheses (e.g., mean()). The double-colon operator :: means accessing an object from a package.