small changes in example R code