http://www.perlmonks.org?node_id=1020367


in reply to Feed data to R using Statistics::R

As far as I can tell, Statistics::R can only transfer scalars and refs to simple arrays (ie, no AoA, etc).

One reasonable solution would be to convert your data into a single vector or string that you can reconstitute in R. Besides files, another possibility is to get data from a database (which is what I did since that's where my data was anyway). Maybe Statistics::R could be extended to emulate R's MySQL driver so that a "data.frame" could be transferred to/from Perl. I'll suggest this to the author or might even attempt it myself ... once I've learned R's weird data structures well enough.

Perhaps obvious but yet another possibility is to skip R completely since it's quite possible that the statistical functions you need might already be available directly.

Update: This feature has already been requested at CPAN.