r codes from coursera - r programming