R scripts from USC COMM 645 2012