rtags(utils)
rtags()所属R语言包:utils
An Etags-like Tagging Utility for R
ETAGS像标签实用为R
译者:生物统计家园网 机器人LoveR
描述----------Description----------
rtags provides etags-like indexing capabilities for R code, using R's own parser.
rtagsR代码提供ETag的类似索引功能,使用R的自己的解析器。
用法----------Usage----------
rtags(path = ".", pattern = "\\.[RrSs]$",
recursive = FALSE,
src = list.files(path = path, pattern = pattern,
full.names = TRUE,
recursive = recursive),
keep.re = NULL,
ofile = "", append = FALSE,
verbose = getOption("verbose"))
参数----------Arguments----------
参数:path, pattern, recursive
Arguments passed on to list.files to determine the files to be tagged. By default, these are all files with extension .R, .r, .S, and .s in the current directory. These arguments are ignored if src is specified.
参数传递到list.files确定要签的文件。默认情况下,这些扩展名的所有文件.R,.r,.S,.s在当前目录中。如果src指定这些参数将被忽略。
参数:src
A vector of file names to be indexed.
被索引的文件名的向量。
参数:keep.re
A regular expression further restricting src (the files to be indexed). For example, specifying keep.re="/R/[^/]*\\.R$" will only retain files with extension .R inside a directory named R.
正则表达式进一步限制src(被索引文件)。例如,指定keep.re="/R/[^/]*\\.R$"将只保留有扩展名的文件.R名为R目录内。
参数:ofile
Passed on to cat as the file argument; typically the output file where the tags will be written ("TAGS" by convention). By default, the output is written to the R console (unless redirected).
传递cat说法;通常的输出文件将被写入标签(file公约)"TAGS"。默认情况下,将输出写入到R控制台(除非重定向)。
参数:append
Logical, indicating whether the output should overwrite an existing file, or append to it.
逻辑,表明输出是否应该覆盖现有的文件,或追加到它。
参数:verbose
Logical. If TRUE, file names are echoed to the R console as they are processed.
逻辑。如果TRUE,文件名呼应,因为他们正在处理的R控制台。
Details
详情----------Details----------
Many text editors allow definitions of functions and other language objects to be quickly and easily located in source files through a tagging utility. This functionality requires the relevant source files to be preprocessed, producing an index (or tag) file containing the names and their corresponding locations. There are multiple tag file formats, the most popular being the vi-style ctags format and the and emacs-style etags format. Tag files in these formats are usually generated by the ctags and etags utilities respectively. Unfortunately, these programs do not recognize R code syntax. They do allow tagging of arbitrary language files through regular expressions, but this too is insufficient.
许多文本编辑器允许功能和其他语言对象的定义,以快速,方便地坐落在源文件中通过标记工具。此功能需要相关的源文件进行预处理,生产指数(或标签)的文件,其中包含的名称和其相应的位置。标记文件格式有多种,最流行的是vi风格的ctags的格式和emacs风格的ETag的格式。通常在这些格式标记文件生成分别ctags和etags公用事业。不幸的是,这些方案不承认R代码的语法。他们这样做允许通过正则表达式的任意语言文件的标记,但是这也是不够的。
The rtags function is intended to be a tagging utility for R code. It parses R code files (using R's parser) and produces tags in Emacs' etags format. Support for vi-style tags is currently absent, but should not be difficult to add.
rtags函数的目的是R代码标记效用。它解析R代码文件(使用R的解析器)和生产在Emacs的ETag的格式标记。支持vi风格的标签是目前缺席,但不应该是困难的补充。
作者(S)----------Author(s)----------
Deepayan Sarkar
参考文献----------References----------
http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/emacs.html#Tags
参见----------See Also----------
list.files, cat
list.files,cat
举例----------Examples----------
## Not run: [#无法运行:]
rtags("/path/to/src/repository",
pattern = "[.]*\\.[RrSs]$",
keep.re = "/R/",
verbose = TRUE,
ofile = "TAGS",
append = FALSE,
recursive = TRUE)
## End(Not run)[#结束(不运行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|