c++ output to R