Description Usage Arguments Details Examples
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.
1 2 3 | tracking_on(path = file.path(getwd(), "project-store"), .global = "abort")
tracking_off()
|
path |
Where to locate the object store (see storage::object_store). |
.global |
How to handle globalenv when it is not empty. |
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
commit
s. 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:
"abort"
- the default, aborts the tracking of globalenv
is not
empty
"replace"
- replace the contents of globalenv
with the chosen
commit
"merge"
- merge the contents of globalenv
with the chosen commit;
this creates a new commit in the process, which is immediately written
back to the object store
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.