Helper R function

Used in Exploratory Data Analysis - Assignment 1