What is R
R is both a programming language and software environment for statistical computing, which is free and open-source (https://www.r-project.org/about.html).
The was initiated by Robert Gentleman and Ross Ihaka (University of Auckland) in the early 1990s as a different implementation of the S language, which was developed at Bell Laboratories.
Since 1997, R has been developed by the .
R is platform independent and can run on Microsoft Windows, Mac OS and Unix/Linux systems.
Popularity: https://www.tiobe.com/tiobe-index/
Getting Started
To get started, you’ll need to install two pieces of software:
Why RStudio?
Easier to use (everything is in one space)
Many useful integrations (e.g. R-projects, R-markdown, shiny …)
Plenty of shortcuts (alt + shift + k)
Plenty of cheatsheets (see top panel)
Glossary
command: user input (text or numbers) that R understands
script: a sequence of commands collected in a text file, each separated by a new line
environment: a list of named variables that we have generated/imported by means of a series of commands
history: the list of past commands thaty we have used
help: a documentation of all the functions available in R (the user manual)
package: a collection of additional functions and dataset
LS0tCnRpdGxlOiAgICAgICAgIkJpb2luZm9ybWF0aWNzIGZvciBQaGFybWFjeSIKIyBvdXRwdXQ6ICAgICBiZWFtZXJfcHJlc2VudGF0aW9uCiMgdGhlbWU6ICAgICAgYm94ZXMKIyBjb2xvcnRoZW1lOiBkb2xwaGluCiMgZm9udHRoZW1lOiAgc2VyaWYKIyB0b2M6ICAgICAgICBUUlVFCi0tLQoKYGBge3Igc2V0dXAsIGluY2x1ZGU9RkFMU0UsIGVjaG89RkFMU0V9CmxpYnJhcnkoa25pdHIpCm9wdHNfY2h1bmskc2V0KGVjaG8gPSBGQUxTRSkKCmxpYnJhcnkodGlkeXZlcnNlKQpsaWJyYXJ5KHJlc2hhcGUyKQpgYGAKCiMgV2hhdCBpcyBSCgpSIGlzIGJvdGggYSBwcm9ncmFtbWluZyBsYW5ndWFnZSBhbmQgc29mdHdhcmUgZW52aXJvbm1lbnQgZm9yIHN0YXRpc3RpY2FsIGNvbXB1dGluZywgd2hpY2ggaXMgZnJlZSBhbmQgb3Blbi1zb3VyY2UgKDxodHRwczovL3d3dy5yLXByb2plY3Qub3JnL2Fib3V0Lmh0bWw+KS4KClRoZSBcZW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