Learn R Programming

mStats (version 3.4.0)

ilog: Create a copy of your output in a text format

Description

ilog() creates a text copy of your output. ilog.close() closes the ilog() function. ilog.clear() clears for the prompt error caused when the environment is removed.

Usage

ilog(logfile = "log.txt", append = FALSE)

ilog.close()

ilog.clear()

Arguments

logfile

Name of desired log file in .txt format

append

logical value

Details

ilog is a two-step function that allows you a record of your console. A log is a file containing what you type and console output. If a name is not specified, then ilog will use the name <unnamed>.txt.

ilog opens a log file and ilog.close close the file.

Warnings:

However, clearing objects from the workspace along with hidden objects removes ilog's .logenv environment, hence throwing an error when it's attempted to be closed. An error message Error in (function (cmd, res, s, vis) : object '.logenv' not found will be thrown.

In that case, console prompt is stuck at log> . If this error occurs, use ilog.clear() function to revert back to normal.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
## my first log
ilog("../myFirstLog.tx")
str(infert)
str(iris)
ilog.close()

## in case of error: ".logenv" not found
# ilog.clear()
# }

Run the code above in your browser using DataLab