If a specific function is very large or has lots of documentation, it can make sense to give it its own file, named after the function. This advice should inform your general policy, but there are exceptions to every rule. While you’re free to arrange functions into files as you wish, the two extremes are bad: don’t put all functions into one file and don’t put each function into its own separate file. ![]() The file name should be meaningful and convey which functions are defined within. ![]() The Tidyverse Style Guide offers some general advice about file names and also advice that specifically applies to files in a package. However, a few more conventions can make the source code of your package easier to navigate and relieve you of re-answering “How should I name this?” each time you create a new file. The only hard rule is that your package should store its function definitions in R scripts, i.e. files with extension.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |