mrup: Manage recent projects

View source: R/mrup.R

mrupR Documentation

Manage recent projects

Description

An add-in for managing the RStudio Recently Used Projects list. It simplifies opening projects that do not appear in the RStudio projects drop-down menu as well as projects to be added to, or removed from the recent project drop-down menu. It also makes it possible to rename existing projects without manually navigating the file system

Usage

mrup()

Details

The four functions of the app are each accessed through a dedicated tab at the bottom of the window.

Open tab

The "Open project" tab makes it easier than navigating the directory system to locate old projects. The chosen directory and all sub-directories are searched and all projects found are listed. The search directory can be changed by clicking the link and navigating to the desired location.

It is possible to open the chosen project in either the current or a new RStudio session.

Remove tab

The RStudio menu shows a list of the 10 most recently used projects. This is based on the project_mru file which may contain more than 10 projects (apparently 15 max?). The remove tab lists the entire contents of the project_mru file, and allows any of them to be removed.

Pressing the Remove button creates a modified list to replace the current list.

Replacement only takes place if the Save changes button is pressed.

Add tab

All subdirectories of the ~/R directory are searched for .Rproj files, and may take a few seconds to complete. The directory searched is the same as set in the "Open project" tab, where it can also be changed.

Once done, a list is generated that indicates how long it has been since each project was modified. Selected projects are shown in a table that also shows the full path to the project. Pressing Cancel closes the app without making any changes

Pressing the Add button creates a list with all selected projects placed at the top of the project list. Replacement only takes place if the Save changes button is pressed. Pressing Cancel closes the app without making any changes

Since the list can only show 10 projects, those further down will be removed, but will stay on the project_mru file (for a while at least).

NB: It may take several seconds to locate all project files (even in the default location).

Rename tab

As with opening and adding projects to the MRU list, the projects listed are those found in the directory set in the "Open project" tab. After making changes pressing the refresh button allows the list to be updated without restarting the add-in.

When renaming, select 1 project and enter the new name in the box, without a file extension. As long as the project directory has the same name as the project itself, both shall be renamed, and the .Rproj extension will remain intact.

The name change is implemented immediately on pressing Rename, with no need to press Save, and without the ability to cancel. To undo a rename, the project can be re-renamed straight away. Pressing save is required to update the RStudio drop down menu. In order to rename the same project more than once (e.g. to restore the original name) it is currently necessary to reload the app by pressing the reload button at the top right of the viewer pane.

There may be instances where the project has a name that is different from the containing directory. In this case only the .Rproj file (and therefore the project itself) is renamed. If it is desired that the names be made the same, changing the .Rproj first to match the directory, then renaming again to the desired name will result in both the directory and project acquiring the new name.


jmcvw/mrup documentation built on June 5, 2024, 4:26 p.m.