code for R