sdc_log {sdcLog}R Documentation

Create Stata-like log files from R Scripts

Description

This function creates Stata-like log files from R Scripts. It can handle several files (in a character vector) at once.

Usage

sdc_log(r_script, destination, replace = FALSE, append = FALSE, local = FALSE)

Arguments

r_script

character Path of the R script to be run with logging.

destination

One of:

  • character Path of the log file to be used.

  • file connection to which the log should be written. This is especially useful, when you have nested calls to sdc_log() and want to write everything into the same log file. Then, create a single file connection and provide this connection to all calls to sdc_log() (and close it afterwards).

replace

logical Indicates whether to replace an existing log file.

append

logical Indicates whether to append an existing log file.

local

One of:

  • logical Indicates whether to evaluate within the global environment (FALSE) or the calling environment (TRUE).

  • environment A specific evaluation environment. Determines the evaluation environment. Useful whenever sdc_log() is called from within a function, or for nested sdc_log() calls. By default (FALSE) evaluation occurs in the global environment. See also source.

Value

character vector holding the path(s) of the written log file(s).


[Package sdcLog version 0.5.0 Index]