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.
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: https://www.r-project.org/help.html.
How to install R?
R can be installed on different operating systems.
For Windows PC
Download the latest version of R from this url: https://cloud.r-project.org/bin/windows/base/
Double click the downloaded file for a Windows style installer. Select default options to proceed the installation.
Download R from this url: https://cloud.r-project.org/bin/macosx/
Double click the downloaded file for installation.
For Mac OS X 10.4 or earlier, please use this link http://cloud.stat.ucla.edu/bin/macosx/old/R-2.9.2.dmg
- For Linux
- See the instruction for Ubuntu, Redhat, SUSE and Debian at https://cloud.r-project.org/bin/linux/
Rstudio (the desktop version) is a free and open source integrated development environment (IDE) you may find useful.
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. https://doi.org/10.35566/advstats. ISBN: 978-1-946728-01-2.
To take the full advantage of the book such as running analysis within your web browser, please subscribe.