2.5 Workspace

The workspace is your current R working environment and includes any user-defined objects (vectors, matrices, data frames, lists, functions). The following code provides the basics for understanding, configuring and customizing your current R environment.

2.5.3 Command History

You can view previous commands one at a time by simply pressing the up arrow on your keyboard or view a defined number of previous commands with:

2.5.4 Saving and loading your workspace

You can save and load your workspaces. Saving your workspace will save all R files and objects within your workspace to a .RData file.

Note that saving the workspace without specifying the working directory will default to saving in the current directory. You can further specify where to save the .RData by including the path: save(object1, object2, file = "/users/name/folder/myfile.RData")

2.5.6 Shortcuts

To access a menu displaying all the shortcuts in RStudio you can use option + shift + k. Within RStudio you can also access them in the Help menu » Keyboard Shortcuts.