Skip to the content ForoHackers
Log inJoin

R: start here

R
#3087 · · Quote · 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

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply