找回密码
 注册
查看: 14561|回复: 0

R语言:options()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:32:58 | 显示全部楼层 |阅读模式
options(base)
options()所属R语言包:base

                                        Options Settings
                                         选项设置

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Allow the user to set and examine a variety of global options which affect the way in which R computes and displays its results.
允许用户设置和审查各种影响全局选项的方式,其中R计算并显示其结果。


用法----------Usage----------


options(...)

getOption(x, default = NULL)

.Options



参数----------Arguments----------

参数:...
any options can be defined, using name = value or by passing a list of such tagged values.  However, only the ones below are used in base R. Further, options('name') == options()['name'], see the example.  
可以定义任何选项,使用name = value或通过这种标签值的列表。然而,只有下面是用来在基地R.此外,options('name') == options()['name'],看到的例子。


参数:x
a character string holding an option name.
拿着一个选项名称字符串。


参数:default
if the specified option is not set in the options list, this value is returned.  This facilitates retrieving an option and checking whether it is set and setting it separately if not.
如果没有在选项列表中设置指定的选项,这个值返回。这有利于检索选项,检查它是否被设置,并设置它分开,如果不。


Details

详情----------Details----------

Invoking options() with no arguments returns a list with the current values of the options.  Note that not all options listed below are set initially.  To access the value of a single option, one should use getOption("width"), e.g., rather than options("width") which is a list of length one.
调用options()不带参数的选项的当前值返回一个列表。请注意,并非所有下面列出的选项是最初的设置。要访问一个选项的值,应该使用getOption("width"),例如,而不是options("width")这是一个长度为1的列表。

.Options also always contains the options() list (as a pairlist, unsorted), for S compatibility.  Assigning to it will make a local copy and not change the original.
.Optionsoptions()的兼容性列表(作为pairlist,未分类),也总是包含。分配给它会使一个本地副本,并没有改变原来的。


值----------Value----------

For getOption, the current value set for option x, or NULL if the option is unset.
getOption,当前值选项“x或NULL如果选项设置。

For options(), a list of all set options sorted by name.  For options(name), a list of length one containing the set value, or NULL if it is unset.  For uses setting one or more options, a list with the previous values of the options changed (returned invisibly).
对于options(),按名称排序的所有设置选项列表。 options(name),列表长度设定值之一,或NULL如果没有设置。使用设置一个或多个选项,与以前的值更改的选项列表(不可见)返回。


基本的R使用选项----------Options used in base R----------




add.smooth: typically logical, defaulting to TRUE.  Could also be set to an integer for specifying how many (simulated) smooths should be added.  This is currently only
add.smooth:通常的逻辑,默认为TRUE。也可以设置为一个整数,指定多少(模拟)平滑应增加。这是目前唯一




browserNLdisabled: logical: whether newline is
browserNLdisabled:逻辑是:是否换行




checkPackageLicense: logical, not set by default.  If true, library asks a user to accept any non-standard license at first use.
checkPackageLicense:逻辑,而不是默认设置。如果情况属实,library要求用户接受第一次使用任何非标准许可证。




check.bounds: logical, defaulting to FALSE.  If true, a warning is produced whenever a vector (atomic or list) is extended, by something
check.bounds:逻辑,拖欠FALSE。每当一个矢量(原子或list)延伸,由东西,如果情况属实,产生一个警告




continue: a non-empty string setting the prompt used
continue:一个非空的字符串设置提示使用




defaultPackages: the packages that are attached by default when R starts up.  Initially set from value of the environment variable R_DEFAULT_PACKAGES, or if that is unset to c("datasets", "utils", "grDevices", "graphics", "stats", "methods").  (Set R_DEFAULT_PACKAGES to NULL or a comma-separated list of package names.)   A call to options should be in your ".Rprofile" file to ensure that the change takes effect before the base package is
defaultPackages:当R启动,默认情况下,重视包。最初从环境变量的值设置R_DEFAULT_PACKAGES,或如果没有设置c("datasets", "utils", "grDevices", "graphics", "stats", "methods")。 (设置R_DEFAULT_PACKAGESNULL或包名逗号分隔的列表)。一个options调用应该在你的.Rprofile文件,以确保变更生效前基本包




deparse.max.lines: controls the number of lines used when deparsing in traceback, browser, and upon entry to a function whose debugging flag is set.
deparse.max.lines:控制时使用deparsing traceback,browser,在进入一个函数的调试标志设置的行的数目。




digits: controls the number of digits to print when printing numeric values.  It is a suggestion only.  Valid values are 1...22 with default 7.  See the note in
digits:控制打印时,打印数值的位数。它是唯一的一个建议。有效值是1 ... 22默认为7。请参阅附注




digits.secs: controls the maximum number of digits to print when formatting time values in seconds.  Valid values
digits.secs:控制数字打印在几秒钟格式化时间值时的最大数量。有效值




download.file.extra: Extra command-line argument(s) for
download.file.extra:额外的命令行参数(S)




download.file.method: Method to be used for download.file.  Currently download methods "internal", "wget" and "lynx" are available. There is no default for this option, when method = "auto"
download.file.method方法download.file使用。目前下载的方法"internal","wget"和"lynx"可用。有没有这个选项默认情况下,当method = "auto"




echo: logical.  Only used in non-interactive mode, when it controls whether input is echoed.  Command-line option --slave sets this to FALSE, but otherwise
echo:逻辑。仅用于在非交互模式,当它控制输入是否是呼应。命令行选项--slave设置FALSE,但另有




encoding: The name of an encoding, default
encoding:编码名称,默认




error: either a function or an expression governing the handling of non-catastrophic errors such as those generated by stop as well as by signals and internally detected errors.  If the option is a function, a call to that function, with no arguments, is generated as the expression.  The default value is NULL: see stop for the behaviour in that case.  The functions dump.frames and recover provide alternatives that allow post-mortem debugging.  Note that these need to specified as e.g. options(error=utils::recover) in startup files such as
error:无论是功能或表达的非灾难性的错误处理如stop以及内部检测到的信号和错误产生的。如果该选项是一个函数,该函数调用不带参数,生成的表达。默认值是NULL:看到stop在这种情况下的行为。职能dump.frames和recover提供替代方案,允许验尸调试。请注意,这些需要例如指定options(error=utils::recover)如启动文件




expressions: sets a limit on the number of nested expressions that will be evaluated.  Valid values are 25...500000 with default 5000.  If you increase it, you may also want to start R with a larger protection stack; see --max-ppsize in Memory.  Note too that you may cause a segfault from overflow of the C stack, and on OSes
expressions:设置一个嵌套的表达式将被评估的限制。有效的值是25 ...默认5000 500000。如果增加了,你也可能要开始具有较大的保护栈ŕ;看到--max-ppsizeMemory。还请注意,您可能会导致一个segfault从C栈溢出,操作系统




keep.source: When TRUE, the source code for functions (newly defined or loaded) is stored internally allowing comments to be kept in the right places.  Retrieve the source by printing or using deparse(fn, control =       "useSource").
keep.source当TRUE,职能的源代码(新定义或加载)内部存储允许将保持在正确的地方的意见。检索打印或使用deparse(fn, control =       "useSource")源。

The default is interactive(), i.e., TRUE for
默认是的interactive(),即TRUE




keep.source.pkgs: As for keep.source, used only when packages are installed.  Defaults to FALSE unless the
keep.source.pkgs:keep.source,仅用于软件包安装的时候。 FALSE除非默认




max.print: integer, defaulting to 99999. print or show methods can make use of this option, to limit the amount of information that is printed, to something in the order of (and typically slightly less than)
max.print:整数,默认为99999。 print或show方法可以使用此选项,以限制打印的信息量,在该命令的东西(通常略小于)




OutDec: character string containing a single-byte character.  The character to be used as the decimal point in output conversions, that is in printing, plotting and as.character
OutDec:包含一个单字节字符的字符串。将用于在输出转换小数点的字符,这是在印刷,策划和as.character




pager: the command used for displaying text files by file.show. Defaults to "internal", which uses a pager similar to the GUI console.  Another possibility is "console" to use the console itself. Can be a character string or an R function, in which case it needs to accept the arguments (files, header,         title, delete.file) corresponding to the first four arguments of
pager:该命令用于显示文本文件file.show。默认"internal",它使用类似的GUI控制台寻呼机。另一种可能性是,“"console"使用控制台本身。可以是一个字符串或一个R的功能,在这种情况下,它需要接受参数(files, header,         title, delete.file)相应的前四个参数




papersize: the default paper format used by postscript;  set by environment variable R_PAPERSIZE when R is started: if that is unset or invalid it defaults to "a4", or "letter" in US and Canadian locales.
papersize:postscript使用环境变量R_PAPERSIZER是启动时:如果是未设置或无效,默认"a4"或<默认文件格式X>在美国和加拿大的语言环境。




pdfviewer: default PDF viewer. The default is set from the environment variable R_PDFVIEWER, which defaults to the full path to open.exe, a utility supplied with R.
pdfviewer:默认的PDF阅读器。默认设置环境变量R_PDFVIEWER,默认的完整路径open.exe,实用与R.提供




printcmd: the command used by postscript for printing; set by environment variable R_PRINTCMD when R is started.  This should be a command that expects either input to be piped to "stdin" or to be given a single filename
printcmd“:用于印刷postscript命令,环境变量设置R_PRINTCMDR是启动时。这应该是一个希望通过管道输送到stdin或将一个单一的文件名或者输入命令




prompt: a non-empty string to be used for R's prompt;
prompt:一个非空的字符串为R的提示;

see save.
看到save。




scipen: integer.  A penalty to be applied when deciding to print numeric values in fixed or exponential notation.  Positive values bias towards fixed and negative towards scientific notation: fixed notation will be preferred unless it is
scipen:整数。要套用一个点球时,决定将打印在固定或指数符号的数值。将优先考虑,除非它是正面的价值观,对固定和对科学记数法的负偏差:固定的符号




showWarnCalls, showErrorCalls: a logical. Should warning and error messages show a summary of the call stack?  By default error calls are shown in non-interactive
showWarnCalls,showErrorCalls:一个逻辑。应该警告和错误消息显示调用堆栈的总结?默认情况下,错误的来电显示在非交互




showNCalls: a integer.  Controls how long the sequence of calls must be (in bytes) before ellipses are used.  Defaults to
showNCalls:一个整数。控制调用顺序必须是长期(以字节为单位),用于椭圆之前。默认为




show.error.messages: a logical.  Should error messages be printed?  Intended for use with try or a
show.error.messages:一个逻辑。应印制错误消息?用于使用try或




stringsAsFactors: The default setting for arguments of
stringsAsFactors:为参数的默认设置




texi2dvi: used by functions texi2dvi and texi2pdf in package tools.
texi2dvi功能texi2dvi和texi2pdf包tools使用。




timeout: integer.  The timeout for some Internet operations, in seconds.  Default 60 seconds.  See
timeout:整数。一些互联网业务超时,以秒。默认为60秒。见




topLevelEnvironment: see topenv and
topLevelEnvironment:看到topenv“




useFancyQuotes: controls the use of directional quotes in sQuote, dQuote and in rendering text help (see Rd2txt in package tools).  Can be TRUE, FALSE, "TeX" or
useFancyQuotes:sQuote,dQuote“在渲染文本帮助(见Rd2txt包tools)控制定向引号的使用。可以TRUE,FALSE,"TeX"




verbose: logical.  Should R report extra information on progress?  Set to TRUE by the command-line option
verbose:逻辑。应该R报告进展情况的额外信息?设置为TRUE命令行选项




warn: sets the handling of warning messages.  If warn is negative all warnings are ignored.  If warn is zero (the default) warnings are stored until the top&ndash;level function returns.  If fewer than 10 warnings were signalled they will be printed otherwise a message saying how many (max 50) were signalled.  An object called last.warning is created and can be printed through the function warnings.  If warn is one, warnings are printed as they occur.  If warn is two or larger all
warn:设置警告信息的处理。 warn如果是负的所有警告被忽略。 warn如果是零(默认值)警告直至顶层函数返回存储。如果少于10个警告信号,否则他们将印一个消息,说多少(最多50个)信号。创建对象称为last.warning一个可以通过打印功能warnings。如果warn是一个警告被打印发生。如果warn是两个或更大




warnPartialMatchArgs: logical.  If true, warns if
warnPartialMatchArgs:逻辑。如果为true警告说,如果




warnPartialMatchAttr: logical.  If true, warns if partial matching is used in extracting attributes via
warnPartialMatchAttr:逻辑。如果情况属实,警告说,如果中提取属性通过使用部分匹配




warnPartialMatchDollar: logical.  If true, warns if
warnPartialMatchDollar:逻辑。如果为true警告说,如果




warning.expression: an R code expression to be called if a warning is generated, replacing the standard message.  If non-null it is called irrespective of the value of option
warning.expression:R代码表达,被称为生成一个警告,取代了标准的消息。如果非空,它被称为期权价值无关




warning.length: sets the truncation limit for error and warning messages.  A non-negative integer, with allowed values
warning.length:设置错误和警告消息的截断限制。一个非负整数,允许值




width: controls the maximum number of columns on a line used in printing vectors, matrices and arrays, and when filling by cat.
width:控制在用于印刷的向量,矩阵和数组的行列的最大数目,并填写cat。

Columns are normally the same as characters except in CJK languages.
列通常是除中日韩语言的字符相同。

You may want to change this if you re-size the window that R is running in.  Valid values are 10...10000 with default normally 80.  (The limits on valid values are in file "Print.h" and can be changed by re-compiling R.)  Some R consoles automatically change the value when they are resized.
您可能要更改默认值通常80,如果你重新调整窗口大小,R是运行有效的值是10 ... 10000。 (有效值限制在文件Print.h,可以通过重新编译R.改变)一些R安慰值时,它们的大小自动改变。

See the examples on Startup for one way to set this automatically from the terminal width when R is started.
单程从终端宽度设置R是启动时自动启动的例子。

The "factory-fresh" default settings of some of these options are
其中一些选项的“工厂新鲜的默认设置

TRUE
TRUE

FALSE
FALSE

"+ "
"+ "

7
7

TRUE
TRUE

"native.enc"
"native.enc"

NULL
NULL

5000
5000

interactive()
interactive()

FALSE
FALSE

99999
99999

"."
"."

"> "
"> "

0
0

TRUE
TRUE

60
60

FALSE
FALSE

0
0

1000
1000

80
80

Others are set from environment variables or are platform-dependent.
其他设置环境变量,或者是平台依赖的。


在包grDevices设置的选项----------Options set in package grDevices----------

These will be set when package grDevices (or its namespace) is loaded if not already set.
这些将被设置时,包grDevices(或它的命名空间)被加载,如果尚未设置。




device: a character string giving the name of a function, or the function object itself, which when called creates a new graphics device of the default type for that session.  The value of this option defaults to the normal screen device (e.g., X11, windows or quartz) for an interactive session, and pdf in batch use or if a screen is not available.  If set to the name of a device, the device is looked for first from the global environment (that is down the usual search path) and then in the grDevices namespace.
device:一个字符串给一个函数的名称,或函数对象本身,它被调用时创建一个新的图形,该届会议的默认类型的设备。该选项默认值正常屏幕设备(例如,X11,windows或quartz)一个交互式会话,pdf在批量使用或如果屏幕不可用。如果设置设备名称,设备首先是看从全球环境(即通常的搜索路径),然后在grDevices命名空间。

The default values in interactive and non-interactive sessions are configurable via environment variables R_INTERACTIVE_DEVICE and R_DEFAULT_DEVICE respectively.
在交互式和非交互式会话的默认值是通过环境变量R_INTERACTIVE_DEVICE和R_DEFAULT_DEVICE分别配置。




device.ask.default: logical.  The default for
device.ask.default:逻辑。默认




locatorBell: logical.  Should selection in locator and identify be confirmed by a bell?  Default TRUE.
locatorBell:逻辑。应选择在locator和identify钟证实?默认TRUE。




windowsTimeout: (Windows-only) integer vector of length 2 representing two times in milliseconds.  These control the double-buffering of windows devices when that is enabled: the first is the delay after plotting finishes (default 100) and the second is the update interval during continuous plotting (default 500).  The values at the time the
windowsTimeout:(仅限Windows)整数向量的长度代表以毫秒为单位的2倍2。这些控制windows时启用设备的双缓冲:首先是延迟之后绘制完成(默认为100),第二个是在不断更新策划的时间间隔(默认为500)。当时的价值观


包图形使用的其他选项----------Other options used by package graphics----------




max.contour.segments: positive integer, defaulting to 25000 if not set.  A limit on the number of segments in a single contour line in contour or
max.contour.segments:正整数,默认25000如果没有设置。对contour或数段在一个单一的轮廓线的限制


在包的统计设置的选项----------Options set in package stats----------

These will be set when package stats (or its namespace) is loaded if not already set.
这些将被设置时,包stats(或它的命名空间)被加载,如果尚未设置。




contrasts: the default contrasts used in model fitting such as with aov or lm. A character vector of length two, the first giving the function to be used with unordered factors and the second the function to be used with ordered factors.  By default the elements are named
contrasts:默认contrasts如aov或lm模型拟合。特征向量的长度为两个,先给予函数用于无序的因素,第二个被责令因素的功能。默认情况下,元素被命名为




na.action: the name of a function for treating missing
na.action:为函数的名称处理失踪




show.coef.Pvalues: logical, affecting whether P values are printed in summary tables of coefficients.  See
show.coef.Pvalues:逻辑,是否影响P值系数汇总表打印。见




show.nls.convergence: logical, should nls
show.nls.convergence:逻辑,应nls




show.signif.stars: logical, should stars be printed on
show.signif.stars:逻辑,应星被印上




ts.eps: the relative tolerance for certain time series
ts.eps:在一定的时间序列的相对宽容




ts.S.compat: logical.  Used to select S compatibility for plotting time-series spectra.  See the description of argument
ts.S.compat:逻辑。用于选择绘制时间序列谱的兼容性。参见参数描述


包utils的设置选项----------Options set in package utils----------

These will be set when package utils (or its namespace) is loaded if not already set.
这些将被设置时,包utils(或它的命名空间)被加载,如果尚未设置。




BioC_mirror: The URL of a Bioconductor mirror for use by setRepositories, e.g. the default "http://www.bioconductor.org" or the European mirror "http://bioconductor.statistik.tu-dortmund.de".  Can be set
BioC_mirror:使用Bioconductor镜一个setRepositories的网址,例如:默认"http://www.bioconductor.org"或欧洲镜子"http://bioconductor.statistik.tu-dortmund.de"。可以设置




browser: default HTML browser used by help.start() and browseURL on UNIX, or a non-default browser on Windows.  Alternatively, an R function that
browser:默认的HTML浏览器使用help.start()和browseURL在UNIX或Windows上的非默认浏览器。另外,R函数




ccaddress: default Cc: address used by create.post (and hencebug.report and
ccaddress:默认抄送:地址create.post(,因此bug.report和使用




de.cellwidth: integer: the cell widths (number of characters) to be used in the data editor dataentry. If this is unset (the default), 0, negative or NA, variable
de.cellwidth:整数:在数据编辑器dataentry使用的单元格宽度(字符数)。如果这是未设置(默认),0,负或NA,变量




demo.ask: default for the ask argument of
demo.askask参数:默认




editor: a non-empty string, or a function that is called with a file path as argument.  Sets the default text editor, e.g., for edit.  Set from the environment variable EDITOR on UNIX, or if unset VISUAL or
editor:一个非空字符串,或一个文件路径作为参数调用的函数。设置默认的文本编辑器,例如edit,。从设置环境变量EDITORUNIX上,或者如果没有设置VISUAL




example.ask: default for the ask argument of
example.askask参数:默认




help.ports: optional integer vector for setting ports
help.ports:设置端口可选的整数向量




help.search.types: default types of documentation
help.search.types:默认类型的文件




help.try.all.packages: default for an argument of
help.try.all.packages:默认参数




help_type: default for an argument of
help_type:默认参数




HTTPUserAgent: string used as the user agent in HTTP requests.  If NULL, HTTP requests will be made without a user agent header.  The default is R (<version> <platform>
HTTPUserAgent:用于在HTTP请求的用户代理字符串。如果NULL,HTTP请求,将没有一个用户代理头。默认情况下是的<code>&#341;(<版本> <platform>




install.lock: logical: should per-directory package locking be used by install.packages?  Most useful for binary installs on Mac OS X and Windows, but can be used in a startup file for source installs via R CMD INSTALL.  For binary installs, can also be
install.lock:逻辑:每个目录包锁install.packages?通过R CMD INSTALL最有用的二进制安装在Mac OS X和Windows,但可用于在启动源文件安装。对于二进制安装,也可以是




internet.info: The minimum level of information to be printed on URL downloads etc.  Default is 2, for failure causes.
internet.info:信息的最低水平上印的网址下载等默认为2失败的原因。




mailer: default emailing method used by create.post and hence bug.report and
mailer:create.post,因此bug.report“使用默认的收发邮件的方法




menu.graphics: Logical: should graphical menus be used if available?.  Defaults to TRUE.  Currently applies to select.list, chooseCRANmirror, setRepositories and to select from multiple (text)
menu.graphics:逻辑:应使用图形菜单?。 TRUE默认。目前适用于select.list,chooseCRANmirror,setRepositories“选择多个(文字)




pkgType: The default type of packages to be downloaded and installed &ndash; see install.packages. Possible values are "win.binary" (the default) and "source".  Some Mac OS X builds use "mac.binary.leopard".
pkgType:要下载和安装的软件包的默认类型 - install.packages。可能的值是"win.binary"(默认)和"source"。一些Mac OS X的基础使用"mac.binary.leopard"。




repos: URLs of the repositories for use by update.packages.  Defaults to c(CRAN="@CRAN@"), a value that causes some utilities to prompt for a CRAN mirror.  To avoid this do set the CRAN mirror, by something like local({r <- getOption("repos"); r["CRAN"] <- "http://my.local.cran";    options(repos=r)}).
repos使用update.packages库的URL。默认c(CRAN="@CRAN@"),导致一些公用事业的一个值,提示为CRAN的镜子。为了避免这样设置CRAN的镜子,像local({r <- getOption("repos"); r["CRAN"] <- "http://my.local.cran";    options(repos=r)})的东西。

Note that you can add more repositories (Bioconductor and Omegahat, notably) using setRepositories().
请注意,您可以添加更多的库(的Bioconductor和Omegahat),特别是使用setRepositories()。




SweaveHooks, SweaveSyntax: see Sweave.
SweaveHooks,SweaveSyntax:看到Sweave。




unzip: a character string, the path of the command used for unzipping help files, or "internal". Defaults to "internal" when the internal unzip code is used.
unzip:一个字符串,用于解压缩帮助文件,或"internal"命令的路径。默认为"internal"当内部的解压缩代码。


在包平行设置的选项----------Options set in package parallel----------

These will be set when package parallel (or its namespace) is loaded if not already set.
这些将被设置时,包parallel(或它的命名空间)被加载,如果尚未设置。




mc.cores: a integer giving the maximum allowed number of additional R processes allowed to be run in parallel to the current R process.  Defaults to the setting of the environment variable MC_CORES if set.  Most applications which use this assume a limit of 2 if it is unset.
mc.cores:给予进一步的开发所允许的最大数量的一个整数进程允许运行在平行于目前的R过程。默认MC_CORES如果设置环境变量的设置。大多数应用程序都使用这种假设限制了2如果没有设置。


仅在Unix上使用的选项----------Options used on Unix only----------




dvipscmd: character string giving a command to be used in the (deprecated) off-line printing of help pages via
dvipscmd:字符串给一个要通过使用(不推荐)帮助页印刷线的命令


仅在Windows上使用的选项----------Options used on Windows only----------




warn.FPU: logical, by default undefined.  If true, a warning is produced whenever dyn.load repairs the
warn.FPU:逻辑,默认情况下,未定义。如果情况属实,每当产生一个警告dyn.load维修


参考文献----------References----------

The New S Language. Wadsworth &amp; Brooks/Cole.

举例----------Examples----------


op &lt;- options(); utils::str(op) # op() may contain functions.[OP()可能包含的功能。]

getOption("width") == options()$width # the latter needs more memory[后者需要更多的内存]
options(digits = 15)
pi

# set the editor, and save previous value[设置编辑器,并保存先前的值]
old.o <- options(editor = "nedit")
old.o

options(check.bounds = TRUE, warn = 1)
x &lt;- NULL; x[4] &lt;- "yes" # gives a warning[发出警告]

options(digits=5)
print(1e5)
options(scipen=3); print(1e5)

options(op)     # reset (all) initial options[重置初始选项(全部)]
options("digits")

## Not run: ## set contrast handling to be like S[#无法运行:#设置对比度处理,如S]
options(contrasts = c("contr.helmert", "contr.poly"))

## End(Not run)[#结束(不运行)]

## Not run: ## on error, terminate the R session with error status 66[#无法运行:#错误,错误状态66 R会话终止]
options(error = quote(q("no", status=66, runLast=FALSE)))
stop("test it")

## End(Not run)[#结束(不运行)]

## Not run: ## Set error actions for debugging:[#无法运行:#设置为调试错误的行动:]
## enter browser on error, see ?recover:[#输入错误时的浏览器,看到恢复?]
options(error = recover)
## allows to call debugger() afterwards, see ?debugger:[#允许调用调试器()之后,看到调试?]
options(error = dump.frames)
## A possible setting for non-interactive sessions[#可能设置一个非交互式会话]
options(error = quote({dump.frames(to.file=TRUE); q()}))

## End(Not run)[#结束(不运行)]

  # Compare the two ways to get an option and use it[比较两种方法得到一个选项,并用它]
  # acconting for the possibility it might not be set.[acconting它可能无法设置的可能性。]
if(as.logical(getOption("performCleanp", TRUE)))
   cat("do cleanup\n")

## Not run: [#无法运行:]
  # a clumsier way of expressing the above w/o the default.[一个笨拙的方式表达上述的W / O默认。]
tmp <- getOption("performCleanup")
if(is.null(tmp))
  tmp <- TRUE
if(tmp)
   cat("do cleanup\n")

## End(Not run)[#结束(不运行)]


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 08:53 , Processed in 0.021115 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表