R is an open source programming language created in 1993 by Ross Ihaka and Robert Gentleman.

#17on PLDB | 31Years Old | 690kRepos |

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...

- Tags: programming language, arrayLang
- There are at least 689,533 R repos on GitHub
- Early development of R happened in University of Auckland
- The Google BigQuery Public Dataset GitHub snapshot shows 20k users using R in 29k repos on GitHub
- Check out the 84 R meetup groups on Meetup.com.
- There are 29,980 members in the R subreddit
- There are 1,329 Project Euler users using R
- In the 2021 StackOverflow developer survey R programmers reported a median salary of $59,454. 5% of respondents reported using R. 4,185 programmers reported using R, and 4,015 said they wanted to use it
- Explore R snippets on Rosetta Code
- R on HOPL
- R ranks #11 in the TIOBE Index
- R Ubuntu package
- ANTLR grammar for R
- R LSP implementation
- CodeMirror package for syntax highlighting R
- Monaco package for syntax highlighting R
- GitHub supports syntax highlighting for R
- R appears in the Quine Relay project
- Learn R on exercism.
- There is 1 Jupyter Kernel for R
- There are 2 central package repositories for R: 1. 2.
- Indeed.com has 3,912 matches for "r data scientist".
- r-project.org was registered in 1999
- See also: (25 related languages) Common Lisp, S, Scheme, Julia, C, Fortran, Java, Python, LaTeX, APL, MATLAB, GNU Octave, Knitr, Sweave, UTF-8, RStudio, Eclipse, Emacs, LyX, Perl, Ruby, F#, SPSS, Stata, Mathematica
- 38 PLDB concepts link to R: Ace Editor, Apache Arrow, Catala, checked-c, cloc, dexvis, dplyr, Eiffel, HAL Format, highlight.js, Ibis, invokator, JSL, Lux, mal, MongoDB, Nit, Node.js, Observable Framework, Ohayo, oil, Particles, Pygments, Racket, raptorjit, Red, Ren-C, Revolution, RMarkdown, Rye, SciPy, spry, Statsplorer, Tea, tidyverse, v8, Xgboost, XGBoost

Example from Riju:

```
print("Hello, world!")
```

Example from hello-world:

```
cat("Hello World")
```

Example from the Hello World Collection:

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

Example from Linguist:

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

Example 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)
```

R Keywords

`if else repeat while function for in next break TRUE FALSE NULL Inf NaN NA NA_integer_ NA_real_ NA_complex_ NA_character_ ...`

Feature | Supported | Example | Token |
---|---|---|---|

Standard Library | ✓ | print("Hello, World!") | |

Conditionals | ✓ | ||

Functions | ✓ | ||

While Loops | ✓ | ||

Booleans | ✓ | TRUE FALSE | |

Assignment | ✓ | = | |

Print() Debugging | ✓ | ||

Line Comments | ✓ | # A comment | # |

Pipes | ✓ | # R has pipes via a library like dplyr starwars %>% filter(species == "Droid") | |

Operator Overloading | ✓ | ||

Lazy Evaluation | ✓ | ||

File Imports | ✓ | source("filename.r") | |

Comments | ✓ | # A comment | |

Bitwise Operators | ✓ | ! x x & y x && y x | y x || y xor(x, y) | |

Strings | ✓ | "hello world" | " |

Case Insensitive Identifiers | X | ||

Semantic Indentation | X | ||

Zero-based numbering | X | ||

MultiLine Comments | X |