R language for scientist
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 (formerly AT&T, now Lucent Technologies) 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 provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, ...) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.
One of R's strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.
At 2013-08-27 08:43:32 PM
R operates on named data structures. The simplest such structure is the numeric vector, which is a single entity consisting of an ordered collection of numbers. To set up a vector named
> x <- c(10.4, 5.6, 3.1, 6.4, 21.7)
This is an assignment statement using the function
A number occurring by itself in an expression is taken as a vector of length one.
Notice that the assignment operator (‘
> assign("x", c(10.4, 5.6, 3.1, 6.4, 21.7))
The usual operator,
Assignments can also be made in the other direction, using the obvious change in the assignment operator. So the same assignment could be made using
> c(10.4, 5.6, 3.1, 6.4, 21.7) -> x
If an expression is used as a complete command, the value is printed and lost7. So now if we were to use the command
the reciprocals of the five values would be printed at the terminal (and the value of
The further assignment
> y <- c(x, 0, x)
would create a vector