I am planning to write a substantially big program in R for the first time. Following my usual procedure, I have designed around 15 classes, which are distributed in 5 components. As I see it, each class (definition and associated methods) should be in each own file and each component have its own sub-directory. The desired structure is thus:
-R
-component_0
-classA
-classB
-component_1
-classC
-classD
Initially I created an empty project(using RStudio), but when I tried to use roxygen I realized that a package structure was necessary. Upon creating a package I was struck by its inability to support sub-directories.
I realize that developing my project as a package is essential, especially because I'd like seeing it in CRAN. But destroying my tree structure is something I definitely want to avoid. As I imagine it, the documentation should also have the same structure.
Can someone explain why this restriction exists? Is there any way to avoid it and accomplish what is self-explanatory in most computer languages, like C++?
Also, note that I've assigned a class to a file, rather than a function, which is the common practice. This seems to me the best option, since I've designed object-oriented software. Any comments upon that?