lbraglia / RStata

[R package]: A R-Stata interface
112 stars 37 forks source link

capturing printed output from stata into a dataframe #33

Open mcewenkhundi opened 1 year ago

mcewenkhundi commented 1 year ago

Is it possible to capture the printed output from STATA into a dataframe?

x <- data.frame(a = rnorm(3), b = letters[1:3])

stata("sum a", data.in = x)

. sum a

Variable | Obs Mean Std. Dev. Min Max ------------+-------------------------------------------------------- a | 3 -.5603985 .3000552 -.7720861 -.2170166

For instance, the above printed results being captured into a data frame in R. Thank you.