Seamless embedding of R in C++ programs