r-project code for BI393