Closed luispfonseca closed 5 years ago
This is true. This error occurs in Stata and not R. When Stata starts to define a very large matrix - that was written by R - it generates this error, due to its matsize limit.
The question is do you actually want this huge matrix to be returned to Stata? if so, you can do the following:
rcall
will attempt to return it to Stata, which results in this problem. PS, vanilla
mode only means that it starts with a fresh R environment. But the data communication is the same at the end of each call, i.e. all matrices and scalars are returned to Stata.
Thanks! I was confusing things regarding the vanilla mode. Makes sense.
Clearing the matrix from R at the end of the R script made a huge difference in this case. Not just it avoids those errors, but there are speed gains of 95+% when the data being moved starts getting large. I was already moving the data back through csv files.
should be solved in rcall 3.0.0 BETA
I'm calling R using the vanilla mode and I have a command that works fine for smaller datasets but I get an error as soon as I'm dealing with a matrix above 400 entries in R. I'm calling R in vanilla mode and dealing with moving data in and out of Stata and R by saving the files myself.
The error I get is
matsize too small
. I wasn't expecting this error since I'm calling R in vanilla mode and taking care of bringing data back and forth through files and not through rcall.Something strange I noticed in the trace is the following:
Since I'm calling it in vanilla mode, I wasn't expecting it to be working as it says there on preparing to return objects from R to Stata. Do you know if this is intended, or I'm misunderstanding how it is working in the background?
Thanks!