Create r_2.R

little script to compute r_2.
Hopefully it works...