startStata: Open a Stata instance in a local server-like mode to be used...

startStataR Documentation

Open a Stata instance in a local server-like mode to be used by R through doInStata

Description

A wrapper around Stata “server” code

Usage

startStata(timeout = 60, start_cmd = getOption("statapath"),
  compath = tempdir(), exit_on_error601 = FALSE,
  verify=TRUE)

Arguments

timeout

Seconds to wait for the response/confirmation from Stata. Default: 60.

start_cmd

A string specifying a system command line to start Stata, e.g.: on Windows OS '"C:\\Program Files\\Stata14\\StataMP.exe"'. Default: the contents of option "statapath" obtined with getOption('statpath').

compath

A path to a directory where the R<->Stata information exchange sub-directory should be created. Default: tempdir().

exit_on_error601

Logical: should Stata be closed when the R–Stata data exchange working directory disappears and Stata “server” stops (Stata error 601)? Default: FALSE.

verify

Logical (default: TRUE). Should R wait for the confirmation that Stata “server” has been started. Use it as an escape hack if Stata starts, but the verification cannot be obtained.

Value

An object of S3 class 'StataID' if Stata confirms that the 'server' is ready, else an error.


alekrutkowski/RStataLink documentation built on March 22, 2023, 2:18 a.m.