4  Introduction to R

The S Programming Language is a statistical programming language developed at Bell Labs “to turn ideas into software, quickly and faithfully” (Chambers 1998).

R is a modern implementation of the S language and part of the GNU Project.

R is an interpreted language, allowing interactive work with data. It is written in C, Fortran, and R itself.

Some of R’s strengths:

See also: What is R? on the R Project website.

4.1 Keeping up to date

This book was compiled using R version 4.6.1 (2026-06-24).
Make sure you have the latest version by visiting the R project website.

New versions of R are released regularly and it is a good idea to keep your version of R and installed packages updated.

You can get the version of R currently in use by printing the version object:

version
               _                           
platform       aarch64-apple-darwin23      
arch           aarch64                     
os             darwin23                    
system         aarch64, darwin23           
status                                     
major          4                           
minor          6.1                         
year           2026                        
month          06                          
day            24                          
svn rev        90187                       
language       R                           
version.string R version 4.6.1 (2026-06-24)
nickname       Happy Hop                   

It’s also a good idea to keep a log of the version of R and installed packages when beginning a new project. An easy way to do this is to save the output of sessionInfo():

R version 4.6.1 (2026-06-24)
Platform: aarch64-apple-darwin23
Running under: macOS Golden Gate 27.0

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1

locale:
[1] C.UTF-8/C.UTF-8/C.UTF-8/C/C.UTF-8/C.UTF-8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] htmlwidgets_1.6.4 compiler_4.6.1    fastmap_1.2.0     cli_3.6.6        
 [5] tools_4.6.1       htmltools_0.5.9   otel_0.2.0        yaml_2.3.12      
 [9] rmarkdown_2.32    knitr_1.52        jsonlite_2.0.0    xfun_0.61        
[13] digest_0.6.39     rlang_1.3.0       evaluate_1.0.5   

4.2 Further study

Optional reading: