I am trying to pass a matrix of 150*4000 real numbers to R with RLink. If I try to pass the whole matrix the process seems to take forever, without stopping for errors. The interesting part is that if i pass the first 606 columns then the data is passed immediately, but if I add a single column more then it takes forever.
I guess that I am reaching some threshold on data size (which is approx. 2MB with
ByteCount). Can I overcome this?
Edit: Trying to reproduce the problem on random data I've realized that the 607th column of my data contains some Integers, mixed with the rest of Real numbers. This leads to a simple solution that I'll post below
I am on macosx 10.12.4, using R 3.2.2 and mma 10.2
The code I use to install RLink and pass the data, following Szabolcs' Guide:
SetEnvironment["DYLD_LIBRARY_PATH" -> "/Library/Frameworks/R.framework/Resources/lib"] Needs["JLink`"] SetOptions[InstallJava, JVMArguments -> "-Xmx3g"]; Needs["RLink`"] InstallR["RHomeLocation" -> "/Library/Frameworks/R.framework/Resources/", "RVersion" -> 3] RSet["data", data]