Learning to program in R