stata_exe: Install the path to your Stata executable in your '.Renviron'...

View source: R/stata.R

stata_exeR Documentation

Install the path to your Stata executable in your .Renviron file

Description

This function will add the path to your Stata executable to your .Renviron file. After you have installed your Stata path, it can be called at any time with Sys.getenv("STATA_EXE"). do_stata() will automatically use STATA_EXE when running .do files in batch mode.

Usage

stata_exe(path, install = FALSE, overwrite = FALSE)

Arguments

path

Path to your Stata executable

install

Install the path in your .Renviron file for use in future sessions

overwrite

Overwrite an existing STATA_EXE that you already have in your .Renviron file

Details

If you do not have an .Renviron file, the function will create one for you. If you already have an .Renviron file, the function will append the key to your existing file, while making a backup of your original file for disaster recovery purposes.

Examples


## Not run: 

stata_exe("C:/Program Files/Stata17/StataMP-64.exe", install = TRUE)
# After first installation, reload your environment or restart R
readRenviron("~/.Renviron")


## End(Not run)


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