This function restores the development environment from a previously created restore point, allowing you to revert your workspace to a previous state.
workspace_restore(n_threads = 2, is_interactive = interactive())
Integer. Default 2
. The number of threads to use for the
saving process.
Logical. Default interactive()
. This parameter is
used for package development purposes only, and it is recommended to avoid
changing this setting.
Nothing.
The workspace_restore()
function restores the current development
environment from a save state. When using this function two options will be
presented:
Latest
Selecting the latest restore point issues a warning about resetting the global environment and asks for confirmation
Upon confirming, it restores the workspace to the latest restore point and displays a "Restore complete" message
List out the restore points
Selecting to list out the restore points presents a menu with available restore points
Including the date and time along with any optional note associated with each restore point
Upon selecting a specific restore point, it warns about resetting the global environment and asks for confirmation
Upon confirming, it restores the workspace to the chosen restore point and displays a "Restore complete" message
There are two ways to restore the environment
Clear
Wipe the environment clean and restore the workspace from the wanted file
This option is best if you want to reproduce the wanted environment when it was saved
Merge
Combines the current environment/workspace with the wanted file
There are two merge styles
1: Current environment: When bringing in the workspace from the wanted file, it will prioritize the current environments variables if the same variable is used in both environments
2: Restore point: When bringing in the workspace from the wanted file, it will prioritize the restore file's variables if the same variable is used in both environments
Other workspace functions:
workspace_save()
if (FALSE) {
# Initiate the restore process
workspace_restore()
}