R scripts for BigData