JReportToFile: Send console (i.e. text) output to a file

View source: R/plot_to_file.R

JReportToFileR Documentation

Send console (i.e. text) output to a file

Description

Sends the text output of an arbitrary R expression or function to a text file.

Usage

JReportToFile(filename, expr, createDirectory = TRUE)

Arguments

filename

Name of the file to write to. If NULL, output destination is unaffected by this function.

expr

An expression which outputs the text to be written.

createDirectory

If TRUE and filename is located in a directory which doesn't exist, the directory will be created.

Value

The result of evaluating plotExpr is returned invisibly (which means it is not automatically printed).

See Also

sink, capture.output for saving text output into a variable.

Examples

## Not run: 
JReportToFile("test.txt", print("Hello world!"))

## End(Not run)


JimMcL/JUtils documentation built on Nov. 7, 2024, 11:25 a.m.