R script for mac