I have released a Stata package in GitHub that allows running R in Stata interactively, and more importantly, allows communicating of data, matrix, scalar, and macro from Stata to R, and automatically retrieves objects with matrix, character, numeric, and list classes back to Stata, with real-time update.
For example, let's define 2 matrices in Stata and pass them to R using the st.matrix() function, which belongs to Rcall package. Then I sum the two matrices in R.
Now, I also can access the new matrix C that was created in R, within Stata rclass. i.e.
The package is not on ssc yet, but you can install it from GitHub.
What it needs now, is testing. So if you work with R and Stata, you may want to do your torture test and provide some feedback.
I have also written a basic torture test which can serve as a basic introduction to the package.
For example, let's define 2 matrices in Stata and pass them to R using the st.matrix() function, which belongs to Rcall package. Then I sum the two matrices in R.
Code:
. matrix A = (1,2\3,4) . matrix B = (96,96\96,96) . R: C <- st.matrix(A) + st.matrix(B) . R: C [,1] [,2] [1,] 97 98 [2,] 99 100
Code:
. mat list r(C) r(C)[2,2] c1 c2 r1 97 98 r2 99 100
The package is not on ssc yet, but you can install it from GitHub.
Code:
net install Rcall, force from("https://raw.githubusercontent.com/haghish/Rcall/master/")
What it needs now, is testing. So if you work with R and Stata, you may want to do your torture test and provide some feedback.
I have also written a basic torture test which can serve as a basic introduction to the package.
Comment