Introduction to Data Science using R

Programming with R

Brief history of R

  • Until the mid-70s, much of statistical computing work was being done using Fortran.
  • In 1975-76, the S programming language was developed at Bell Labs to an alternative and more interactive approach to statistical computing.
  • R is developed as an open source reimplementation of S with a first beta-release in 2000. R is currently at its third major version.

Why R

  • R is written by statisticians, for statisticians.
  • R has been widely adopted by the statistic community.
  • R contains a wide range of statistical techniques, mainly due to the enthusiastic contributions from the user community. These inclure linear and nonlinear modeling, classical statistical tests, time-series analysis, classification, clustering, and others. It also has excellent tools to help with data acquisition, extration, manipulation, and visualization.

Data Analytic Task

We are studying inflammation in patients who have been given a new treatment for arthritis, and need to analyze the first dozen data sets of their daily inflammation. The data sets are stored in comma-separated values (CSV) format: each row holds information for a single patient, and the columns represent successive days. The first few rows of our first file look like this:


{: .source}

We want to:

  • load that data into memory,
  • calculate the average inflammation per day across all patients, and
  • plot the result.