Skip to the content ForoHackers
Log inJoin

R: start here

R
#581 · Ophuscado · · Report

R is a language and environment for statistics, data analysis and graphics. It was made by statisticians, so data frames, models, tests and plots are built in or a package away. It is used in research, epidemiology, finance and anywhere results must be reproducible, and its interactive workflow suits exploring data and writing reports.

Key concepts

  • Vectors: the basic type; even a single number is a vector, and operations apply to all elements.
  • Data frames: tables of columns with different types, the core structure of analysis.
  • Functional style: functions are values, and apply-family functions replace most loops.
  • Formulas and models: a compact syntax describes a model, such as regression, and fitting returns an object to inspect.
  • Packages: a large repository of statistical methods and data tools, installed per project.
  • Reproducible reports: documents that mix prose, code and results, regenerated on demand.

Vocabulary

  • Factor: a categorical variable with a fixed set of levels.
  • NA: the marker for a missing value, which propagates through calculations.
  • Tidy data: one variable per column, one observation per row.
  • Notebook or report: a document executed to produce its figures and tables.

What to study, in order

  1. Vectors, indexing, functions and the console; compute summary statistics by hand.
  2. Data frames: import a file, clean it, filter, group and summarise.
  3. Plot distributions and relationships, and judge what each chart does and does not show.
  4. Fit and interpret a linear model, and check its assumptions.
  5. Write a reproducible report that regenerates every figure from the raw data.
  6. Learn the basics of writing your own function and package.

Related tags

#data-science #data-visualization #probability #research-software

Log in or join to reply.