Closed ZimmermannYves closed 3 years ago
Hi,
Unfortunately, this is not possible. A golem is "just" an R package, and as long as this is not possible in an R package, it will not be possible inside golem.
(as I write this I can think of a few ways to implement this, but it will deviate from the traditional way of working)
@ColinFay we can use collate in DESCRIPTION to link to subfolder... see :https://stackoverflow.com/a/33779157/1020027
Thank you for your fast reply, Vincent!
I read the https://stackoverflow.com/a/33779157/1020027 and some other stackoverflow articles. It seems that "collate:" does not work anymore.
For now, I will try to implement good names to better organize my scripts.
plot_aaa.R plot_bbb.R ...
Hey @ZimmermannYves,
As @VincentGuyader said, this is a limitation linked to the R package structure and there is unfortunately no reliable way to implement this :(
Here are some recommendation for code organization :
Extract the business logic into another package, so that you have {appname}
and {appnamedep}
for example.
Then, {appname}
imports {appnamedep}
, making the separation of concerns complete
Use the {golem}
functions to organize the code (golem::add_module
, golem::add_utils
& golem::add_fct
, which will name your file in a structured way.
Colin
Hey,
Given that it is a limitation of R itself (not of {golem}
per se), I think this one should be closed for now.
@ZimmermannYves feel free to comment again if you have any other question or ideas :)
Thanks, Colin
Hello,
I am very much enjoying the golem package. After some small project I'm now building a lager one. For this bigger project I would like to neatly organize my R-scripts in subfolders of the main R-folder. For example like this:
R/modules R/functions R/plots ...
Sadly this is not working. You also write in your book "Engineering Production-Grade Shiny Apps" in the chapter 4.2.2 R/": "Note also that this folder can’t contain sub-folders."
Is it no possible to introduce subfolders or is there another way to achieve the same result?
Best regards
Yves