Closed mvuorre closed 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:
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.
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.
I added init_vertical_project()
, which creates a vertical project inside an existing R studio project. closing this issue for now.
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.