Raul Eyzaguirre's R code