shell - Calling R from Stata -
for annoying reason, not able call r-scripts directly @ data center. allowed call stata , , stata have call r scripts. for now, trying use shell command: capture cd c:\\correct\dir shell “c:\\program files\r-3.1.2\bin\rscript.exe" "myfile.r" the paths correct, blue screen when running in stata, , nothing else happens. there message in blue screen, disappears immediately, have no clue says. how can proceed debugging this? there better way doing this? i'd prefer not using additional packages rsource , need certified before installed in data center , lengthy process. i think presence of double backslash causing problem. following works me: stata cd "path\of\choice" shell "c:\program files\r\r-3.1.2\bin\rscript.exe" "test.r" test.r setwd("path\\of\\choice") data(mtcars) mtcars write.csv(mtcars, "cars.csv")