CrumpLab / vertical

R workflow for sharing psychological research
https://crumplab.github.io/vertical/
Other
35 stars 2 forks source link

Create vertical on an existing project #16

Closed mvuorre closed 4 years ago

mvuorre commented 5 years ago

Currently, vertical is designed to create new projects into non-existing directories. However, what if I already have a project with e.g. an experiment, some data and analyses? It would be great to provide functionality (an addin/function?) that creates a vertical project in a specified, existing directory. (Or maybe I could provide a source directory when I start a project, since overwriting an existing R project may be difficult.) I imagine we can adopt something from usethis/devtools to help with this.

CrumpLab commented 4 years ago

This sounds like a good idea to think about.

I imagine some existing folder with content that could be merged to a vertical project is likely to have unknown organization with naming conventions different from what vertical suggests. So, it wouldn't be straightforward to write a function that merged an existing project into a vertical format.

I suppose the current option is to create a new vertical project in a different folder, then manually copy in existing assets from the other folder.

My first thought on creating a vertical project inside an existing project would something like following:

  1. have the function place all of the content in the existing folder into an "old" folder.
  2. then, install the vertical project, making sure to keep the "old" folder in place
  3. then, users move/copy files from the old folder to the vertical folders, with a suggestion to delete the old folder after the merge is completed.
mvuorre commented 4 years ago

Yeah it seems like manual copying would be the best course of action there.

I think this raises a deeper question about how vertical works, though. Currently, it hard-codes and/or assumes quite a few things (names of folders & files, website navigation bar links, etc). If the goal is to have basically a bare bones example that users are assumed to modify manually (including values in pkgdown.yaml), then this approach is fine.

But if the goal is to provide a portable package that can deal with arbitrary components and locations (including existing projects), then I think a radical rethinking is needed. I don't favor this latter approach because it would probably require creating lots of new functions, and therefore increasing the complexity for both the user and maintainer.

Anyway. just some thoughts.

CrumpLab commented 4 years ago

Agreed, the latter approach might be a vertical 2.0 kind of thing, for now I'm content to stick with the bare bones approach.

CrumpLab commented 4 years ago

I added init_vertical_project(), which creates a vertical project inside an existing R studio project. closing this issue for now.