break down R code