simplify.education

Programming language and statistical computing environment · BEGINNER LESSON

R software

R is an open-source programming language and environment for statistical computing and graphics. It includes a console for running code and a package system that extends what it can do.

What R is

R is both a programming language and an environment used for statistical computing and graphics. In practical use, it can run code interactively in a console, from scripts, or inside an integrated development environment such as RStudio. The sources also describe R as open-source and widely used by scientists and non-scientists.

[1] Lesson 1: Introduction to R and RStudio IDE - Bioinformatics [2] R Language Definition - MIT - Massachusetts Institute of ... [3] Introduction to R and Python Programming Languages - Cancer

What is measured or handled

R handles data and computations rather than measuring a physical quantity by itself. Its users work with variables, data types such as integer, double, character, and logical, and data structures such as vectors, lists, data frames, matrices, and factors. These objects are the inputs to functions and the outputs of analyses or graphics.

[3] Introduction to R and Python Programming Languages - Cancer [2] R Language Definition - MIT - Massachusetts Institute of ...

How R works

A function in R is a short program that takes input and returns output. R also supports lazy evaluation, which means function arguments are not always evaluated right away. The language has a class system based on attributes, and methods can be chosen according to an object's class. The MIT source also notes that R is a dialect of S and provides debugging facilities and interfaces to other languages.

[2] R Language Definition - MIT - Massachusetts Institute of ...

Packages and installation

R becomes more useful through packages, which are loadable extensions containing code, data, documentation, and tests. The main repository is the Comprehensive R Archive Network, or CRAN, described as a global network of servers that store identical versions of R code and package materials. The lesson also mentions GitHub as another source, but notes that such packages may not always meet CRAN standards.

[1] Lesson 1: Introduction to R and RStudio IDE - Bioinformatics

Using R comfortably

RStudio is a separate integrated development environment for R that adds a console, editor, plotting tools, history, debugging, and workspace management. R projects help organize work by automatically setting the working directory and keeping related files such as input data, scripts, results, and figures together. Help can be searched through the Help tab, ?functionname, ??keyword, or help.search().

[1] Lesson 1: Introduction to R and RStudio IDE - Bioinformatics

SEE THE IDEA

How R is used in practice

R code is entered in a console or script, functions process data, packages extend available tools, and RStudio plus projects help manage the work.

A simple workflow from writing R code to extending and organizing analysis.

TRY IT YOURSELF

Test your understanding

Choose an answer, then check the explanation.

0 of 3 questions answered
01 Which statement best describes R software?
02 A student saves data, scripts, figures, and results in one folder that also sets the working directory automatically. What is this feature called?
03 If you install a package that adds new code and documentation to R, what is the main reason you did it?

PUT IT TOGETHER

Match each concept to its meaning

Drag a label onto its description, or select a label and then select a description. This also works with a keyboard.

Sources and further reading

This general lesson was generated from public source material. It explains a concept; it does not interpret a private paper or provide medical advice.

  1. Lesson 1: Introduction to R and RStudio IDE - Bioinformatics
  2. R Language Definition - MIT - Massachusetts Institute of ...
  3. Introduction to R and Python Programming Languages - Cancer
Apply this to a paper →