Introduction to R

What is R?

R is a statistical language and software for data analysis and graphing. It is an open-source implementation of the S language which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. Therefore, much code written for S runs directly under R.

R is built through packages, including the base package and thousands of extended packages or extensions.The base package contains the basic functions which let R function as a language: arithmetic, input/output, basic programming support, etc. It also allows the creation of extension packages based on it. With the base package and the extensions, many statistical data analysis can be conducted and high quality statistical graphs can be produced.

R is available as Free Software under the terms of the Free Software Foundation's GNU General Public License in source code form. It compiles and runs on a wide variety of UNIX platforms and similar systems (including FreeBSD and Linux), Windows and Mac OS.

Why R?

R is now widely used by both statisticians and applied researchers for good reasons.

  • R is free and open-source and can be used on Windows, Mac OS, Linux and even online, as in this book.
  • R is an integrated environment suitable for data manipulation, data analysis and graphical display.
  • R is designed around a true computer language, and it allows users to write their own functions and packages for even the newest developed statistical methods.
  • R is supported by thousands of users around the world. Try out this link:

How to install R?

R can be installed on different operating systems.

Start R

R is most easily used in an interactive manner. You ask R a question and it gives you an answer. Questions are asked and answered on the command line. To start R, the following procedure can be used.

  • On an operating system with Windows interface such as Windows and Mac OS X, double click the R icon will open the R console. For example, the console on Windows looks like

  • On machines without Windows interface such as Ubuntu server, one can start R by typing R and return in the terminal.


To cite the book, use: Zhang, Z. & Wang, L. (2017-2022). Advanced statistics using R. Granger, IN: ISDSA Press. ISBN: 978-1-946728-01-2.
To take the full advantage of the book such as running analysis within your web browser, please subscribe.