整理包说明中的字段 [英] Collate field in package Description
问题描述
我很抱歉,因为我很可能会在编写R包的手册中找到这个答案,但是在阅读和查看其他包的Collate字段时,我无法100%弄清楚该字段的用途.用通俗易懂的语言(我的英语是英语),软件包描述文件中的整理"字段有什么作用?一个人想放什么?
I apologize as I know that this answer is likely in the manuals for writing an R package but in my reading and looking at other package's Collate fields I can't figure out 100% what this field is for. In plain language (mine is English) what does the Collate field in the Description file of a package do? What would one want to put there?
推荐答案
我认为这是由于时间和情况而产生的,当时R/
目录中的文件的来源顺序(相对于词典默认)很重要. .onLoad()
函数通常位于名为zzz.R
的文件中的类似原因.
I think it comes from a time and situation when the order in which the files in the R/
directory were sourced (as opposed to the lexicographic default) still mattered. A similar reason for why the .onLoad()
function is often in a file named zzz.R
.
对于它的价值,我的软件包中没有一个使用DESCRIPTION中的"Collate:"字段.
For what it is worth, not one of my packages uses the "Collate:" field in DESCRIPTION.
并且,由于我们喜欢经验方法,因此这里是一台包含所有CRAN来源的计算机上的快速grep
:
And as we're fond of empirical measures, here is a quick grep
on a machine with all CRAN sources:
$ grep ^Collate */DESCRIPTION | wc -l
292
$ ls -1 */DESCRIPTION | wc -l
3779
所以这是所有包装的7.7%.除非您真的必须,否则我真的不会为此担心.
So that is 7.7% of all packages. I really would not worry about this unless you really must.
这篇关于整理包说明中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!