43

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.

jomuller
  • 1,032
  • 2
  • 10
  • 19
  • do you think is it the best place to ask this question? Or it is an indirect way for self advertising? general advise keep lower case , simple to type. ( I vote to close this question) – agstudy Jun 13 '14 at 09:09
  • @agstudy Yes, I think it's the good place to ask this question. It's not a self advertising, the package I develop is not for general users, but very specific then for a small audience. To avoid any suspicion of self advertising, I will remove the example. And I agree with you, all in lower case seem's simpler to type, but maybe not meaningfull. – jomuller Jun 13 '14 at 09:12
  • 3
    sorry but it is not a programming question. Also, we avoid here to answer based primary opinion question. Mayhe reading [Getting started](http://adv-r.had.co.nz/Package-basics.html) can help you. – agstudy Jun 13 '14 at 09:22
  • @agstudy Sorry if it's not a programming question. I thought that coding style and then namming convention's (like the [google's R coding style](https://google-styleguide.googlecode.com/svn/trunk/Rguide.xml) or the [PEP8](http://legacy.python.org/dev/peps/pep-0008/) in Python), were part of programming process. I'm not yet a professional of the sector then I have to learn. And thank's for the link, it's help! – jomuller Jun 13 '14 at 09:53
  • @jomuller would you consider rewording to say *according to CRAN*? E.g. "What constitutes a good package name according to CRAN?". That way the question is no longer subjective. FYI I have voted to reopen – stevec Jan 31 '21 at 04:52

1 Answers1

40

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.

gagolews
  • 12,836
  • 2
  • 50
  • 75