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())

Arguments

n_threads

Integer. Default 2. The number of threads to use for the saving process.

is_interactive

Logical. Default interactive(). This parameter is used for package development purposes only, and it is recommended to avoid changing this setting.

Value

Nothing.

Details

The workspace_restore() function restores the current development environment from a save state. When using this function two options will be presented:

  1. 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

  2. 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

Restore method

There are two ways to restore the environment

  1. 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

  2. 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

See also

Other workspace functions: workspace_save()

Examples

if (FALSE) {
# Initiate the restore process
workspace_restore()
}