added supplement and R code from it

only changed style.
removed ";"
swapped in "<-"  where there were "=" for assignment
indentation