# R

R is an actively used programming language created in 1993. R is an open source programming language and software environment for statistical computing and graphics that is supported by the R Foundation for Statistical Computing. The R language is widely used among statisticians and data miners for developing statistical software and data analysis. Polls, surveys of data miners, and studies of scholarly literature databases show that R's popularity has increased substantially in recent years. Read more on Wikipedia...

26Years Old | 1,056,807Users | 14,241Jobs |

- R ranks in the top 1% of languages
- the R website
- the R wikipedia page
- R first appeared in 1993
- file extensions for R include r, R, RData, rds, rda, rd and rsx
- the R team is on twitter
- tryitonline has an online R repl
- See also: common-lisp, s, scheme, julia, c, fortran, java, python, latex, apl, matlab, octave, knitr, sweave, utf-8, rstudio-editor, eclipse-editor, emacs-editor, lyx-editor, perl, ruby, f-sharp, spss, stata, mathematica
- I have 132 facts about R. what would you like to know? email me and let me know how I can help.

### Example code from the Hello World Collection:

# Hello World in R cat("Hello world\n")

### Example code from Linguist:

hello <- function() { print("hello, world!") } hello()

### Example code from Wikipedia:

install.packages("caTools") # install external package library(caTools) # external package providing write.gif function jet.colors <- colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000")) dx <- 400 # define width dy <- 400 # define height C <- complex( real=rep(seq(-2.2, 1.0, length.out=dx), each=dy ), imag=rep(seq(-1.2, 1.2, length.out=dy), dx ) ) C <- matrix(C,dy,dx) # reshape as square matrix of complex numbers Z <- 0 # initialize Z to zero X <- array(0, c(dy,dx,20)) # initialize output 3D array for (k in 1:20) { # loop with 20 iterations Z <- Z^2+C # the central difference equation X[,,k] <- exp(-abs(Z)) # capture results } write.gif(X, "Mandelbrot.gif", col=jet.colors, delay=100)

Last updated July 8th, 2019