do_stata: Run a Stata '.do' file in batch mode

View source: R/stata.R

do_stataR Documentation

Run a Stata .do file in batch mode

Description

Run a Stata .do file in batch mode from the command line. It is recommended to install the path to your Stata executable first with stata_exe().

Usage

do_stata(file, wd = NULL, stata_exe = NULL)

Arguments

file

A path to a Stata .do file.

wd

Working directory in which to run the .do file. If NULL, the default, the current working directory is used.

stata_exe

The path to your Stata executable. If NULL, the default, will use the STATA_EXE environment variable.

See Also

stata_exe()

Examples

## Not run: 

# Install the path to your Stata executable first
stata_exe("YOUR STATA EXE")
# Run a do file in batch mode
do_stata("script.do")

# Run a do file in batch mode, specifying the Stata executable
do_stata("script.do", stata_exe = "C:/Program Files/Stata17/StataMP-64.exe")


## End(Not run)


CenterOnBudget/Rcbpp documentation built on Jan. 6, 2025, 9:32 p.m.