Package Development: Multiple files or Single File Package Development: Multiple files or Single File r r

Package Development: Multiple files or Single File


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.