R scripts developed for coursework at Duke University