citation(utils)
citation()所属R语言包:utils
Citing R and R Packages in Publications
引用R的刊物和R封装
译者:生物统计家园网 机器人LoveR
描述----------Description----------
How to cite R and R packages in publications.
如何引用在出版物中的R和R封装。
用法----------Usage----------
citation(package = "base", lib.loc = NULL, auto = NULL)
readCitationFile(file, meta = NULL)
参数----------Arguments----------
参数:package
a character string with the name of a single package. An error occurs if more than one package name is given.
用一个单一的包的名称的字符串。发生错误,如果多个包名。
参数:lib.loc
a character vector with path names of R libraries, or NULL. The default value of NULL corresponds to all libraries currently known. If the default is used, the loaded packages are searched before the libraries.
与特征向量的R库的路径名,或NULL。默认值的NULL对应于目前已知的所有库。如果使用默认值,装包库前搜索。
参数:auto
a logical indicating whether the default citation auto-generated from the package "DESCRIPTION" metadata should be used or not, or NULL (default), indicating that a "CITATION" file is used if it exists, or an object of class "packageDescription" with package metadata (see below).
表示是否默认引用自动生成从逻辑的元数据,应使用或没有,或DESCRIPTION(默认),表明包NULL“CITATION&rsquo文件如果存在的话,或一个类的对象"packageDescription"包的元数据(见下文)。
参数:file
a file name.
一个文件名。
参数:meta
a list of package metadata as obtained by packageDescription, or NULL (the default).
packageDescription或NULL(默认)获得一包的元数据的列表。
Details
详情----------Details----------
The R core development team and the very active community of package authors have invested a lot of time and effort in creating R as it is today. Please give credit where credit is due and cite R and R packages when you use them for data analysis.
已经投入了很多的时间和精力,因为它是今天在创建R的R核心开发团队和非常活跃的社区软件包作者。请给予信贷是由于信贷和引用R和R包当您使用这些数据的分析。
Execute function citation() for information on how to cite the base R system in publications. If the name of a non-base package is given, the function either returns the information contained in the "CITATION" file of the package or auto-generates citation information. In the latter case the package "DESCRIPTION" file is parsed, the resulting citation object may be arbitrarily bad, but is quite useful (at least as a starting point) in most cases.
执行功能citation()上如何举出版物的基R系统的信息。如果非基础包的名称,函数返回CITATION文件包或自动生成引文信息中包含的信息。包DESCRIPTION文件在后一种情况下被解析,可能产生的引用对象任意坏,但在大多数情况下非常有用(至少为起点)。
In R >= 2.14.0, one can use a Authors@R field in "DESCRIPTION" to provide (R code giving) a person object with a refined, machine-readable description of the package “authors” (in particular specifying their precise roles). Only those with an author role will be included in the auto-generated citation.
在R> = 2.14.0,可以使用Authors@R领域DESCRIPTION提供(R代码提供)person与精致的,机器可读的对象包的描述“作家”(特别指定其确切的作用)。只有那些与一个作家的角色将包含在自动生成的引用。
If only one reference is given, the print method for the object returned by citation() shows both a text version and a BibTeX entry for it, if a package has more than one reference then only the text versions are shown. The BibTeX versions can be obtained using function toBibtex() (see the examples below).
如果只给出一个参考,为对象的print方法返回citation()显示两个文字版本,并为它的BibTEX进入,如果一个软件包有多个参考则只有文字版本显示。使用功能toBibtex()(见下面的例子),可以得到的BibTEX版本。
The "CITATION" file of an R package should be placed in the "inst" subdirectory of the package source. The file is an R source file and may contain arbitrary R commands including conditionals and computations. Function readCitationFile() is used by citation() to extract the information in "CITATION" files. The file is source()ed by the R parser in a temporary environment and all resulting bibliographic objects (specifically, of class "bibentry") are collected.
CITATIONR包的文件应放在inst包源的子目录。该文件是一个R源文件可以包含任意的R命令,包括条件和计算。功能readCitationFile()使用citation()CITATION文件中提取信息。该文件是source()由一个临时的环境ŕ分析器和所有由此产生的对象(特别是类"bibentry"的)收集书目。
Traditionally, the "CITATION" file contained zero or more calls to citHeader, then one or more calls to citEntry, and finally zero or more calls to citFooter, where in fact citHeader and citFooter are simply wrappers to paste, with their ... argument passed on to paste as is. R 2.12.0 adds a new "bibentry" class for improved representation and manipulation of bibliographic information (in fact, the old mechanism is implemented using the new one), and one can write "CITATION" files using the unified bibentry interface. Such files are not usable with versions of R prior to 2.12.0.
传统,CITATION文件中包含零个或多个调用citHeader,然后调用一个或多个citEntry,终于零个或多个电话citFooter其实citHeader和citFooter只是paste包装...参数,通过对paste是。 ŕ2.12.0增加了一个新的"bibentry"改进代表性和操纵书目信息(事实上,旧机制的实施,使用新)类,可以写CITATION文件使用统一bibentry接口。这些文件是不是与R到2.12.0之前的版本可用。
In R >= 2.14.0, one can include an auto-generated package citation in the "CITATION" file via citation(auto = meta).
在R> = 2.14.0,可以包括在自动生成的包引用的文件通过CITATIONcitation(auto = meta)。
readCitationFile makes use of the Encoding element (if any) of meta to determine the encoding of the file.
readCitationFile利用Encoding元素meta,以确定文件的编码(如有)。
值----------Value----------
An object inheriting from class "bibentry".
继承类"bibentry"对象。
举例----------Examples----------
## the basic R reference[#基本R参考]
citation()
## references for a package -- might not have these installed[#参考 - 包可能没有安装这些]
if(nchar(system.file(package="lattice"))) citation("lattice")
if(nchar(system.file(package="foreign"))) citation("foreign")
## extract the bibtex entry from the return value[#返回值中提取的BibTEX条目]
x <- citation()
toBibtex(x)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|