tracking: Turn tracking on or off

Description Usage Arguments Details Examples

Description

tracking_on turns the tracking mode on, which is signaled by a new prompt, [tracked] >. It also attaches to an object store (see storage::object_store), if one can be found under path. If no object store can be found, and path points to a non-existing directory whose parent directory does exist, then that top-level directory is created and a new object store is created in it.

tracking_off reverses the effect of tracking_on. It removes the callback and brings back the original value of that R session's prompt.

Usage

1
2
3
tracking_on(path = file.path(getwd(), "project-store"), .global = "abort")

tracking_off()

Arguments

path

Where to locate the object store (see storage::object_store).

.global

How to handle globalenv when it is not empty.

Details

When an existing object store is found, and it is not empty, that is, it contains artifacts and commits from previous R sessions, the current R session is set as a continuation of one of those commits. However, if the current global environment (see globalenv) is not empty, it needs to be replaced or merged with the chosen commit. To that extent, the .global argument is consulted. It can take one of the following values:

When tracking is enabled a task callback installed via addTaskCallback. It is used to examine the contents of the global environment each time an R command is successfully executed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# if no object store exists, a new one is created under the
# default "project-store" directory located in the current
# working directory
tracking_on()

# as above, but the new directory is "my-store"
tracking_on("my-store")

## End(Not run)

lbartnik/experiment documentation built on May 20, 2019, 8:27 p.m.