Code Relating to R