User:Ironholds/R

Initial work
R was initially written by Ross Ihaka and Robert Gentleman, colleagues at the University of Auckland. Both had a strong interest in statistical programming, but felt that commercial options on their Macintosh computers were too limited. Instead, they began working on an alternative for their personal use. This was initially based on Ihaka's familiarity with and appreciation of the Scheme programming language but, over time, grew to include more and more syntax similar from the S statistical programming language. The result was, syntactically, very like S, with two major differences (both as a result of the Scheme influence): a fixed amount of memory assigned at startup, combined with regular garbage collection to minimise memory usage, and the use of lexical scoping. They named it R, as both a reference to S and to their shared first initial.

In August 1993, some initial binaries were made available on the s-news mailing list; several people provided feedback, including Martin Mächler, who encouraged Gentleman and Ihaka to release R under the GNU General Public License, resulting in freely reusable and modifiable software. Despite initial reluctance, this release happened in June 1995, the result being a free and open source statistical programming language and environment. As a result of the combination of S-influenced syntax and GNU licensing, R is sometimes referred to as "GNU S". Mächler also volunteered the use of resources at his parent institution, ETH Zurich, to host mailing lists for discussing and maintaining R - by 1997, this led to the creation of the r-announce, r-devel and r-help mailing lists for announcements from the developers, developer discussion and help, respectively. As people began writing packages to extend the language, Kurt Hornik at the Vienna University of Technology began hosting CRAN, the Comprehensive R Archive Network, to host current and past versions of R packages and make them available to download.

Increasing popularity and R Core team
With the introduction of the mailing lists for discussion, R development accelerated, initially focused on matching the capabilities of Version 3 of S. Without the bandwidth to keep up with all the patches and proposed changes, Ihaka and Gentleman formed the R Core team to take over maintenance of the language; by early 1998 this consisted of Gentleman, Ihaka, Mächler and Hornik, along with Peter Dalgaard, Thomas Lumley, Luke Tierney, Paul Murrell, Heiner Schwarte, Friedrich Leisch and Douglas Bates.

Syntax
R's syntax is heavily influenced by Scheme and S, although ... Unlike most other languages, R has no formal language convention

Data structures
R has five common data structures, three homogenous (meaning that all elements must be of the same type) and two heterogenous (contents may be of different types): Unlike other programming languages, R has no scalar elements; all data types are capable of holding multiple elements.

Atomic vectors are of one of four types; logical (containing TRUE and FALSE values), integers (containing whole numbers), double (containing numbers with a decimal place, and also known as numeric) and character (containing text). Construction of atomic vectors is usually done with the  or "combine" function, which detects the type of the provided elements and generates a vector of that type. Each type also has a dedicated constructor: Atomic vectors of different types can be merged into a single, larger vector, but doing so necessitates the coercion of the elements to the type that can most flexibly hold them. The ordering for this runs (from most to least flexible) character, double, integer and logical: mixing a character and logical vector, for example, would produce a character vector, while mixing an integer and a double vector would produce a double. Because vectors are stored contiguously, they cannot be resized; instead, appending to a vector or merging multiple vectors together creates an entirely new object.

Lists are a form of vector, and are sometimes known as "recursive vectors"; the primary distinctions between lists and atomic vectors are that lists can contain elements of different types, and can contain other lists.

Arrays are essentially atomic vectors, with additional attributes specifying the number of rows and columns. They are usually multidimensional, with an array consisting of three or more dimensions. Matrices are a special case of arrays that contain only two dimensions; they are commonly used for statistical operations in R, due to their existence as a mathematical structure.

The most regularly used object for storing data is the data frame, a two-dimensional structure with named columns. Data frames can contain columns of different types (although all elements within a column must have the same type), and architecturally are a modified form of a list.

Operators
R's standard assignment operator is the two-character ; this originated with APL, which heavily influenced R's predecessor, S. The more-standard   can also be used for assignment, but has historically been discouraged due to the use of = in function calls, which rendered the operator ambiguous in some situations.

Additional operators exist around selecting subsets of an object;,   and. is the most common, and tries to preserve the original type of the object; for example,, to retrieve the first element in a list, will always retrieve it as a list, whatever its internal type. , on the other hand, consistently returns a single value;  will retrieve the contents of the first entry of list.

Functional programming
R's function parameters are named, but function calls can optionally rely on the order in which parameter names appear in the function definition:

Lazy evaluation, metaprogramming, et al

Object-oriented programming
R's core language definition contains two different class systems for object-oriented programming. The older one, S3,... S3, S4, R5, R6

Multi-paradigm programming
R is a multi-paradigm programming language; although it is a functional programming language at its core, it contains a variety of methods for engaging in object-oriented programming, influenced by and inherited from S. The

Non-standard evaluation
R's evaluation system is both non-standard and lazy,(ihaka, 305) something built into the initial design.

The non-standard nature of R's evaluation means that it is possible for a function to evaluate not only the values it is given, but also the code used to generate those values. An example of this is the function to load packages,, which is called with the syntax:

The value given (urltools) is neither a reserved word nor a string, and so under R's standard rules of evaluation, this code should fail; the library function should search for an object called, fail to find it in scope, and throw an error. Instead,  takes the value provided, holds it unevaluated, and converts it into a string before processing it further. This is a rare feature of programming languages, and "allows you to write functions that are extremely powerful", but renders code less readable and makes it more difficult to predict the outcome of running it. Robert Gentleman, one of the language authors, explicitly recommends that "users should only make use of [non-standard evaluation] for compelling reasons".

Lexical scoping
R's scope is lexical, meaning that variables stored inside function definitions only exist while the function does. This is not a feature found in S or S Plus, but is native to Scheme and was imported from there by Ihaka and Gentleman when writing R. This functions by associating each function with an environment,

Plotting and data visualisation
R's core language definition can generate visualisations of datasets or calculations, including point and line graphs, density plots, and three-dimensional visualisations.

Packages
R is distinguished by the large number of extensions, or "packages", associated with the language. These are largely hosted on the Comprehensive R Archive Network (CRAN), and as of 2015 over 6,000 distinct packages were available. The existence of packages and the vast number of packages available is seen as a "major strength" of the language, as they make specialised types of analysis that would otherwise only be sold commercially available to interested researchers and programmers. Researchers studying the social dynamics of open source environments have also argued that the package system has played a substantial role in the success of R as a language; it allows developers to collaborate on improving the language without overwhelming the team that maintains the core implementation, and means that the tools available in R increase organically to match user needs. One of the most prominent packages is ggplot2, a data visualisation package that implements Leland Wilkinson's The Grammar of Graphics.

Many of these packages are developed and maintained on R-Forge, a free fork of the SourceForge software similar to GForge, run by the R Foundation. R-Forge offers package authors convenient access to version control, along with package-specific mailing lists and announcement tools.

Conferences
The R community's primary conference is "useR!", which is formally supported by the R Foundation. The first conference was held in Austria from 20-22 May 2004, with a focus on new developments in the core language and distribution, and best programming practices. "useR!" conferences held so far are:


 * useR! 2012, Nashville, Tennessee, USA
 * useR! 2013, Albacete, Spain
 * useR! 2014, Los Angeles, USA
 * useR! 2015, Aalborg, Denmark

Integration with other languages
As a language implemented in C, R provides a native interface to C via the  and   functions. In 2005, Dominick Samperi submitted a dedicated C++ connector as part of the RQuantLib package; this became its own package, Rcpp, in 2006, but was not updated after that year and was archived in 2009. Dirk Eddelbuettel, a Debian and R developer, began work on revitalising this project and released a dedicated C++ API in November 2008, under the Rcpp name. This API was rewritten in 2009 by Eddelbuettel and Romain Francois, and is still maintained, providing a convenient API to connect C++ libraries and code to R. This package provides an easy interface between R and C++ objects, along with syntactic sugar to make C++'s representation of operations more closely represent R's.

Outside of the C/C++ stack, R can be used from Python with the RPy module,

Criticism
The GNU licensing of R has attracted criticism for making the language unattractive to commercial organisations that want to embed R in their projects, due to the license's viral nature.