write an Rdata file from C++

I think nobody has bothered to extract a binary file writer from the R sources to be used independently from R.

Almost twenty years ago I did the same for Octave files as their format is simply: two integers for 'n' and 'k', followed by 'n * k' of data -- so you could read / write with two function calls each.

I fear that for R you would have to cover too many of R's headers -- so the easiest (?) route may be to give the data to R, maybe via Rserve ('loose' connection over tcp/ip) and RInside (tighter connection via embedding), and have R write it.

Edit: In the years since the original answer was written, one such library has been created: librdata.

Tags:

C++

R