-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package for managing R project directories/repositories #17
Comments
This is very intriguing! It almost sounds like a structure-based versus style-based parallel to |
I think this is hard without a goal metric to compare against. We have dozens of packages setting up preferred package / directory structure. Do you want to / need to pick one?
|
@emilyriederer I love the analogy to @jdblischak Awesome suggestions! I wonder whether this package idea would dovetail in any way into your @eddelbuettel I definitely think that defining the scope of the package would give shape the needed dependencies. I'm glad there's some interest in this idea though -- I never know when the problems I'm trying to solve are way too niche. |
pkgnet's function network mapping might be a useful starting point? ...but still a hard problem |
@ataustin Don't be so hard on yourself! There are more than 15K packages on CRAN :-)
Potentially. I have a vignette on migrating an existing project to workflowr. If you develop a method to make that transition easier, we can add it to the vignette. |
@jdblischak Well having you here answers my earlier question "which of many competing alternatives gets picked" ;-) |
@alistaire47 |
@eddelbuettel How can I compute a relative path using base R? I do this a lot in workflowr, and I imagine it would come up in a project that involves reorganizing files and directories.
|
Ahh, so you are projecting from your existing requirements (which may or may not have the need for the noted dependency) to a new and (as of now, mostly unspec'ed) "project". Now I see how one ends up with a dozen dependendies in a package. Learning something new every day 😉 That That feature set is usually good enough for me to normalize a path, get info, expand a glob, etc pp. But I'd have to think about this intersection problem. But ex ante I am not sure it must be solved here. For new project X we may just move/create/delete/renamed/... files below a starting point. Which works with and without |
@jdblischak Got curious, found these two quick SO hits:
That puts it squarely in the "do I reimplement something potentially with new bugs just to avoid a dependency" versus "do I add a dependency though it increase my overall 'surface' of exposure to change and potential breakage". No clear winners there. As always, it depends (and |
I've done both :-) For workflowr, I first wrote it using base R: https://github.com/jdblischak/workflowr/blob/v0.8.0/R/utility.R#L85 Then I switched to R.utils. Then after many hours of debugging errors caused by Given my experience with |
Nope! But some of its code for calculating network metrics on functions might be a useful starting point for figuring out how to map and rearrange directories of code. The lack of guarantees about structure you get with a package make this task a lot harder, though. |
This doesn't eliminate the need for dependencies, but in my current work I build file paths using the |
This is only the seed of an idea.
Walking into someone else's project directory can be daunting, given differences in organization philosophies. Equally challenging is reorganizing your own projects when you have a change in how you wish to organize your files.
I'd like to have a package that analyzes a directory and creates a high-level visual aid of the contents. The package could also help users reorganize their files by creating a mapping from the existing structure to a new desired structure. I'm imagining some kind of text file as a blueprint that specifies the mapping. The blueprint is then used to reorganize the files, and can also be used to undo the process if desired. Upon performing the reorganization, the package might also search scripts for file paths (relative or absolute) and change them to match the new structure so that code continues to run without further alteration.
The text was updated successfully, but these errors were encountered: