Using R

R uses commands

  • Two parts of commands in R: objects and functions and these are separated by ‘ <- ‘, means ‘is created from’.
    • Objects: could be a single or collections of variable (s), stat model.
    • Functions: things that I do in R to create my objects
    • For example, object <- function = object is created from function.
  • Concatenate function c() : make groups together
  • Importing Data: most commonly used R-friendly formats are tab-delimted text(.txt in Excel and .dat in SPSS)


  1. I can put more than one command on a single line if I prefer.
  2. R is case sensitive: capital letter and small letter

Here are some useful links for R

Regression Commands

Vector support machines (April recommended during the WS)

Support vector machine in R (useful article-April recommended)  (can share data-April recommended)

How to read scatterplot matrix in R?

MOOC (Coursera): R programming (4 weeks): Jul/7-Aug/4, 2014



A. Field, J. Miles, Z. Field (2012). Discovering Statistics using R. Sage.