R ARTICLE
History of R
R is a programming language for statistical computing and graphics supported by the R Core Team and the R Foundation for Statistical Computing . Created by statisticians Ross Ihaka and Robert Gentleman , R is used among data miners, bioinformaticians and statisticians for data analysis and developing statistical software. Users have created packages to augment the functions of the R language.
R Introduction
What is R?
- R is a language and environment for statistical computing and graphics.
- It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories by John Chambers and colleagues.
- R can be considered as a different implementation of S.
- There are some important differences, but much code written for S runs unaltered under R.
R environment
R is an integrated suite of software facilities for data manipulation, calculation and graphical display. It includes-
- an effective data handling and storage facility,
- a large, coherent, integrated collection of intermediate tools for data analysis,
- graphical facilities for data analysis and display either on-screen or on hardcopy.
R Syntax
R Command Prompt
- R command prompt by just typing the following command at your command prompt −
$ R
- This will launch R interpreter and you will get a prompt > where you can start typing your program as follows −
> myString <- "Hello, World!"
> print ( myString )
[1] "Hello, World!"
- R does not support multi-line comments but you can perform a trick which is something as follows −
if(FALSE) {
This is a demo for multi-line comments
and it should be put inside either a
single OR double quote"
}
myString <- "Hello, World!"
print( myString )
R Variables
Variable Name -> Validity -> Reason
- var_name% -> Invalid -> Has the character '%'. Only dot(.) and underscore allowed.
- var_name2. -> valid -> Has letters, numbers, dot and underscore
- 2var_name -> invalid -> Starts with a number