R scripts for hadoop