I'm searching a good name for a R package I want to send to the CRAN. I didn't find any information about good practice in R package namming. There is a post about how to analyze packages names but it don't answer my question. There is also the alphabetical list of CRAN packages but it only show what exists, not what is good in practice.
The options are :
library(thepack)
but maybe not mayningfull as the_next_package
;thePack
) to split the words but with the risk for the user to misspell it when calling it's case-sensitive (library(thepack)
is not equal to library(thePack)
) ;the_pack
or the.pack
) but I don't find them elegantRpack
or theRpack
) but we have the same problem than with the Camel Style.It's maybe a trivial question but I think the name of a package is important because its the first interaction between the package and the user. Then must be in the same time meaningful, concise and easy to write when called with the library()
function.
From the Kotlin Android style guide: Package names are all lowercase, with consecutive words simply concatenated together (no underscores).
The Comprehensive R Archive Network (CRAN) is R's central software repository, supported by the R Foundation. It contains an archive of the latest and previous versions of the R distribution, documentation, and contributed R packages. It includes both source packages and pre-compiled binaries for Windows and macOS.
Package names are written in all lower case to avoid conflict with the names of classes or interfaces. Companies use their reversed Internet domain name to begin their package names—for example, com. example. mypackage for a package named mypackage created by a programmer at example.com .
Writing R Extensions only provides the following constraints:
The mandatory ‘Package’ field gives the name of the package. This should contain only (ASCII) letters, numbers and dot, have at least two characters and start with a letter and not end in a dot.
Note that the underscore character, _
, is not allowed.
You might start your research by examining the listing here - in particular, few package names include the dot char, .
.
Also, take look at this SO question for some helpful code. What's more, @agstudy provided a link to Hadley Wickham's tips on his favorite package naming conventions here.
By the way, in case you're planning to submit the package to CRAN, the CRAN team might suggest a name change if it's not appropriate.
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