2017-09-05 110 views
1

我正在撰写我的第一个R包,关于这个话题,Hadley Wickham的优秀book。上面链接的这一部分包括通过包的DESCRIPTION文件添加作者的示例。如何强制R将贡献者(或其他角色)包含在我的包的引用()输出中?

威克姆博士指出,“full list of roles是非常全面的。如果你的包有一个樵夫(‘WDC’),作词(‘LYR’)或服装设计师(‘CST’),舒适地休息,你可以准确地描述他们在创建你的软件包中的作用。“

我遇到的问题是,只有具有“作者”角色的人才会被包含在citation()的包装中 - 樵夫,词组作者和服装设计师都不是。我希望我的软件包的非作者贡献者被列入引文中,但不希望(错误地)将他们列为作者(即具有“作者”角色/ aut)。

例如,如果我包括我的DESCRIPTION文件中的以下(csplisted as “顾问项目”):

[email protected]: c(
    person("John", "Doe", email = "[email protected]", role = c("aut", "cre")), 
    person("Jane", "Smith", email = "[email protected]", role = "csp", comment = "Provided intellectual overview.")) 

... citation('mypackagename')将为下列:

To cite package ‘mypackagename’ in publications use: 

    John Doe (NA). mypackagename: My package description. R package version 0.1.0. 
    https://github.com/link/to/mypackagename 

A BibTeX entry for LaTeX users is 

    @Manual{, 
    title = {mypackagename: My package description}, 
    author = {John Doe}, 
    note = {R package version 0.1.0}, 
    url = {https://github.com/link/to/mypackagename}, 
    } 

此外,?mypackagename返回[NA]为“Author(s)”下的贡献者:

Maintainer: John Doe [email protected] 

Other contributors: 

Jane Smith [email protected] (Provided intellectual overview.) [NA] 

看似来解决这个问题,在Hmiscuses the following的作者在他的DESCRIPTION文件:

Author: Frank E Harrell Jr <[email protected]>, with 
    contributions from Charles Dupont and many others. 

我怎么能力R包含在citation()输出非作家贡献者(其他角色)? Hmisc作者的方法在这里最好吗?看起来这可能会破坏由[email protected]提供的干净的元数据解析,所以我很犹豫使用这种方法。

我将不胜感激任何指针!

+1

在为期刊文章创建引文时,您只列出作者(几乎所有引文样式指南);你不列出确认。为什么这与包装的引用不同?引文应该帮助读者确定所用代码的来源。这并不意味着所有贡献的综合列表。也许你对“引用”有不同的定义。 – MrFlick

+0

@FrankHarrell,或许你可以阐明一下你的想法? – Aaron

+0

糟糕,他在这篇文章中并没有活跃,所以@ [不会工作](https://meta.stackexchange.com/questions/43019/how-do-comment-replies-work)。但他在网站上,所以也许他会看到它... – Aaron

回答

1

您不能在citation()输出中包含其他角色。检查the source of citation(),它解析只有作者场,甚至还有一张纸条源代码就可以了:

## <NOTE> 
    ## Older versions took persons with no roles as "implied" authors. 
    ## Now we only use persons with a name and a 'aut' role. If there 
    ## are none, we use persons with a name and a 'cre' role. 
    ## If this still gives nothing (which really should not happen), we 
    ## fall back to the plain text Author field. 
    ## Checking will at least note the cases where there are no persons 
    ## with names and 'aut' or 'cre' roles. 

所以对你有其他角色的唯一方法是在示例中使用纯文本的描述为Hmisc包。

+0

谢谢你的参考!我会接受你的回答,并感谢你的解释。 –

相关问题