Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What constitutes a good package name according to CRAN? [closed]

Tags:

package

r

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 :

  • Size : Keep the name short (8 characters or less) then it's easy to call with library(thepack) but maybe not mayningfull as the_next_package ;
  • Camel Style : use Camel Style (e.g. 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)) ;
  • Special character : using special characters like "." or "_" to split the words (e.g. the_pack or the.pack) but I don't find them elegant
  • R letter : add an upper case R to indicate that's an R package (e.g. Rpack 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.

like image 309
jomuller Avatar asked Jun 13 '14 09:06

jomuller


People also ask

What should be the package name?

From the Kotlin Android style guide: Package names are all lowercase, with consecutive words simply concatenated together (no underscores).

What are CRAN packages?

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.

What should be the package name in Java?

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 .


1 Answers

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.

like image 80
gagolews Avatar answered Sep 21 '22 02:09

gagolews