R is a statistical computing and graphics language widely used in data science, statistics, and research. Created in the early 1990s by Ross Ihaka and Robert Gentleman at the University of Auckland, R provides an extensive ecosystem of packages (over 21,000 on CRAN) that extend its core functionality for specialized domains. What makes R particularly powerful is its vectorized nature β operations apply to entire data structures without explicit loops, making code both concise and efficient. R 4.1+ introduced the native pipe |> and lambda syntax \(x), reducing dependency on add-on packages for idiomatic pipelines. When working with R, remember that everything is an object, and mastering R's data structures, the apply/purrr family, and the tidyverse ecosystem will dramatically improve your ability to write idiomatic, high-performance code.
What This Cheat Sheet Covers
This topic spans 33 focused tables and 336 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Data Types
| Type | Example | Description |
|---|---|---|
x <- 3.14 | β’ Default numeric type for real numbers (double-precision floating-point) β’ covers both integers and decimals unless explicitly declared otherwise. | |
n <- 5L | β’ Whole numbers β’ requires the L suffix to differentiate from numeric β’ uses less memory than double. | |
s <- "hello" | β’ Text strings enclosed in single or double quotes β’ no distinction between char and string as in other languages. |