Functions to aid generating R and C/C++ code