R Programs for coursera module