I've been poking through a bunch of different packages and I'm noticing that there really isn't a clear and concise method for function storage. Some package authors pack all of them in one file while other authors split them into individual files.
I've read a number of package creation guides but none of them provide specific guidelines or suggestions.
Would love to hear your thoughts on this.
The best reference I have found on the topic thus far is from Hadley Wickham's R book draft. Quoting from there:
It's up to you how you arrange your functions into files, but I suggest grouping related functions into a single file. My rule of thumb is that if I can't remember which file a function lives in, I probably need to split them up into more files - having one function per file is perfectly reasonable, particularly if the functions are large or have a lot of documentation.
I use one function per file. It helps me in the developing stage because I can source
individual file (CTRL+R+S in Eclipse) and have a changed function handy. I also prefer changing tabs than scrolling up and down a single file. But at the end of the day it probably depends on what you're used to and what tools you use for development.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With