code.components function

Convert components to R code