R file to run analysis on Samsung data