Examing a previously stored restore point by invoking the browser.

Share:

Description

The function is mainly for internal use by restore.point.

Usage

1
2
3
restore.point.browser(name, was.forced = FALSE,
  message.text = paste("restore point", name, ", press ESC to return."),
  deep.copy = get.restore.point.options()$deep.copy)

Arguments

name

name under which the variables have been stored

was.forced

flag whether storage of objects was forced. If FALSE (default) a warning is shown if restore.objects is called and is.storing()==FALSE, since probably no objects have been stored.

message.text

initial shown message

deep.copy

when storing or restoring tries to make a deep copy of R objects that are by default copied by reference, like environments. Setting deep.copy = FALSE can substantially speed up restore.point, however.

Value

returns nothing

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
  library(restorepoint)
  
  set.restore.point.options(to.global = FALSE)
  
  # A function that shall swap the left and right part of a vector
  swap.in.vector = function(vec,swap.ind) {
    restore.point("swap.in.vector")
    left  = vec[1:(swap.ind-1)]
    right = vec[swap.ind:nrow(vec)]
    c(right,left)
  }
  swap.in.vector(1:10,4)
  
  # You could call
  restore.point.browser("swap.in.vector")
  
  # But there is no need to. Just running in the R Console (global environment) the command
  restore.point("swap.in.vector")
  # has the same effect (at least once you have set restore.point.options(to.global=FALSE))
  
  # Basically restore.point.browser() is rather an internal function

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.