Closed aghaynes closed 1 year ago
You are right, it will take some method like I suggested for inline results. In the case of an r(table)
, you might use Stata's putexcel
command, like
putexcel set filename.xlsx
matrix A = r(table)'
/*Note the apostrophe after r(table)!*/
putexcel A1 = matrix(A), names
putexcel save
followed by an R code chunk that reads the file and uses the results somehow.
I'll add an example to my documentation. And thanks for the suggestion to add a link here on Github to my website.
Useful package...thanks! Is it possible to make the results from stata available to R for use in further processing downstream?
Stupid example, but say I have
and want to use
r(mean)
in other calculations in following R chunksr(table)
after regress and passing it tokable
perhaps or some such would probably be a better example, but I'm sure you get the idea.I guess the current solution would be similar to that proposed for inline results? Would be cool to be able to specify a (vector of?) outputs to pass from stata back to R...
On a slightly different note, maybe you can add a link to your ssc.wisc site the github repo... in the readme and/or in the repo settings. It's very useful, but not mentioned that I saw...