restore.point: Sets a restore point

Description Usage Arguments

Description

The function behaves different when called from a function or when called from the global environemnt. When called from a function, it makes a backup copy of all local objects and stores them internally under a key specified by name. When called from the global environment, it restores the previously stored objects by copying them into the global environment. See the package Vignette for an illustration of how this function can facilitate debugging.

Usage

1
2
3
4
5
6
restore.point(name, to.global = options$to.global,
  deep.copy = options$deep.copy, force = FALSE,
  display.restore.point = options$display.restore.point,
  indent.level = TRUE, trace.calls = options$trace.calls,
  max.trace.lines = 10, dots = eval(substitute(list(...), env =
  parent.frame())), options = get.restore.point.options())

Arguments

name

key under which the objects are stored. For restore points at the beginning of a function, I would suggest the name of that function.

to.global

if TRUE (default) objects are restored by simply copying them into the global environment. If FALSE a new environment will be created and the restore point browser will be invoked.

deep.copy

if TRUE try to make deep copies of objects that are by default copied by reference. Works so far for environments (recursivly). The function will search lists whether they contain reference objects, but for reasons of speed not yet in other containers. E.g. if an evironment is stored in a data.frame, only a shallow copy will be made. Setting deep.copy = FALSE (DEFAULT) may be useful if storing takes very long and variables that are copied by reference are not used or not modified.

force

store even if set.storing(FALSE) has been called

display.restore.point

shall a text be shown in the console if restore.point is called. Can be useful when informative tracebacks are not readily availbale, e.g. when debugging shiny apps.

indent.level

when display.restore.point=TRUE shall level of nestedness be illustrated by identation

trace.calls

when objects are restored, shall a traceback be shown

max.trace.lines

if trace.calls=TRUE how many lines shall be shown at most in the traceback.

dots

by default a list of the ... argument of the function in which restore.point was called

options

option list to fill the parameter defaults from


restorepoint documentation built on May 2, 2019, 7:47 a.m.