Giter Site home page Giter Site logo

mrup's Introduction

Addin ~ MRUP

An RStudio addin for manipulating the “Most Recently Used Projects” list

Easily open any previous project.
Add projects to, or remove projects from, the recent project drop-down menu.
Easily rename existing projects without navigating the file system manually.

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?).

Install

To install copy the following:

remotes::install_github('jmcvw/mrup')

Use

Click the Addins drop down menu

Then locate the mrup section and click on the description text below


Open tab

In the open tab it is possible to open any RStudio project even if it is not on the recently used list.

The directory structure of your computer can be searched and all projects located within the chosen directory are displayed. The default search location will usually be Documents / Home, but this can be changed by clicking the Change link1. It may take several seconds to complete the search, with the time increasing the closer you get to the root directory of a hard disk. The chosen project can then be opened in either the current session or a new one.

The chosen directory is also used for the Add projects and Rename project tab.


Remove tab

The remove tab lists the contents of the current project_mru file, in its entirety. The means it is possible to see which projects were recently pushed off the bottom, but are still present, on the list. Any file on the list came be completely removed from it on this tab.

Pressing the Remove button creates a modified list to replace the current list. Replacement only takes place if the Save button is pressed. Pressing Cancel discards changes and closes the app.

Add tab

Adding new projects to the recently used list requires searching all subdirectories for .Rproj files. The search directory (i.e the circled input) is the same directory chosen on the Open project tab. A list of all detected projects is displayed 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 the Add button creates a list with all selected projects placed at the top of the project list. Additions only occur if the Save button is pressed. Since the list can only show 10 projects, those further down will be hidden, but will stay on the project_mru file (for a while at least). Pressing Cancel discards changes and closes the app.


Rename tab

Any project can be renamed as long as it is located within the directory chosen in the Open project tab. After renaming, pressing the refresh button allows the list to be updated without restarting the add-in. When renaming, select one 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.

The name change is implemented, on disk, 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, after refreshing the app.


Footnotes

  1. Thanks to the shinyFiles packages creators, Thomas Lin Pedersen et al.

mrup's People

Contributors

jmcvw avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

mrup's Issues

Default MRU has changed

Default MRU path on Windows seems to have changed in RStudio 2022-02 from

AppData/Local/RStudio-Desktop

to

AppData/Local/rstudio**

Refactor

Needs some serious refactoring. Specifically converting operations into functions would make it much easier to remember how it works.

Modularize

I might be better if there was a "choose dir" input in the add projects tab, and maybe the rename projects tab as well.
However, I think it would be best to implement a module to reuse the shinyfiles code, and I seem to have a problem making shinyfiles work with modules.
Refactoring (#1) would likely help with this.

Slow loading

Thank you for the nice plugin, this is something I was looking for, but got aware about recently.

I installed your plugin and tried to use it. However, none of the buttons respond, the button icons are missing and the window is blank, no previously used projects are displayed. I am not able to do anything. Although the guide in the README says "It may take several seconds to complete the search, with the time increasing the closer you get to the root directory of a hard disk.", in my case it takes about three minutes. I don't think this is due to a slow computer because I have quite powerful machine with 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (eight cores) and 64BG of RAM.

About a minute after I start the plugin, I get the following printed in the console nearly 400 times:

Warning in list.dirs(search_dir, full.names = TRUE, recursive = FALSE) :
over-long path

About two minutes after this I get the plugin working.

Warning when navigating dirs with shinyFiles

Two warnings are printed whenever current directory is changed using the shinyFiles widget.
mrup functionality appears unnaffected (?) so far as I can tell.

The warnings:

Warning in is.null(tree) || is.na(tree) :
  'length(x) = 7 > 1' in coercion to 'logical(1)'

Warning in is.null(files$dir) || is.na(files$dir) :
  'length(x) = 2 > 1' in coercion to 'logical(1)'

The warning appears on Mac, haven't checked Windows yet. - Have now, and it does.

There here have been a couple of recent changes in the shinyFiles repo that I maybe need to account for.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.