一个好的R包名称是什么? [英] What's a good R package name?

查看:115
本文介绍了一个好的R包名称是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在搜索好名字,以查找要发送到CRAN的R包.我没有找到有关R包命名中良好实践的任何信息.关于如何分析软件包名称的帖子,但它没有回答我的问题.还有按字母顺序排列的CRAN软件包列表,但仅显示存在的内容,而不是在实践中有什么好处.

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.

这些选项是:

  • 大小:保持名称简短(8个字符或更少),然后使用library(thepack)即可轻松调用,但可能不能像the_next_package那样充实;
  • 驼峰样式:使用驼峰样式( eg thePack)拆分单词,但在调用时区分大小写的情况下,用户可能会拼写错误( library(thepack)不等于library(thePack));
  • 特殊字符:使用特殊字符,例如."或"_"分割单词(例如 the_packthe.pack),但我觉得它们并不雅致
  • R字母:添加大写字母 R 表示这是一个R包(例如 RpacktheRpack),但是我们与骆驼风格有同样的问题.
  • 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.

这可能是一个琐碎的问题,但是我认为程序包的名称很重要,因为它是程序包与用户之间的首次交互.当同时使用library()函数调用时,必须同时有意义,简洁且易于编写.

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.

推荐答案

必填项"Package"(包装)字段提供了包装的名称.该字符应仅包含(ASCII)字母,数字和点,至少应包含两个字符,并以字母开头,而不以点结尾.

请注意,不允许使用下划线字符_.

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, ..

此外,请查看此SO问题,以获取一些有用的代码.此外,@ agstudy提供了指向Hadley Wickham关于他最喜欢的软件包命名约定的提示的链接这里.

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.

顺便说一句,如果您打算将软件包提交给CRAN, 如果不合适,CRAN团队可能会建议您更改名称.

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.

这篇关于一个好的R包名称是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆