What's a good R package name? [closed]

2020-06-30 14:14发布

问题:

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 it the first interaction between the package and the user. Then must be in the same time meaningfull, concise and easy to write when called with the library()function.

回答1:

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.