warning(base)
warning()所属R语言包:base
Warning Messages
警告讯息
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Generates a warning message that corresponds to its argument(s) and (optionally) the expression or function from which it was called.
对应参数(S)和(可选)的表达或功能,它被称为生成一条警告消息。
用法----------Usage----------
warning(..., call. = TRUE, immediate. = FALSE, domain = NULL)
suppressWarnings(expr)
参数----------Arguments----------
参数:...
zero or more objects which can be coerced to character (and which are pasted together with no separator) or a single condition object.
零个或多个对象可以强制转换为字符(并粘贴在一起,没有分隔)或一个单一的条件对象。
参数:call.
logical, indicating if the call should become part of the warning message.
逻辑,表示如果调用应该成为的警告消息的一部分。
参数:immediate.
logical, indicating if the call should be output immediately, even if getOption("warn") <= 0.
逻辑,表示如果调用应该是输出,即使getOption("warn") <= 0的。
参数:expr
expression to evaluate.
表达式。
参数:domain
see gettext. If NA, messages will not be translated.
看到gettext。如果NA,消息不会被翻译。
Details
详情----------Details----------
The result depends on the value of options("warn") and on handlers established in the executing code.
结果取决于options("warn")的价值和在执行的代码建立的处理程序。
If a condition object is supplied it should be the only argument, and further arguments will be ignored, with a message.
如果一个条件对象提供,它应该是唯一的参数,将被忽略的消息,进一步论据。
warning signals a warning condition by (effectively) calling signalCondition. If there are no handlers or if all handlers return, then the value of warn = getOption("warn") is used to determine the appropriate action. If warn is negative warnings are ignored; if it is zero they are stored and printed after the top–level function has completed; if it is one they are printed as they occur and if it is 2 (or larger) warnings are turned into errors. Calling warning(immediate. = TRUE) turns warn <= 0 into warn = 1 for this call only.
warning信号(有效)调用signalCondition警告条件。如果没有处理程序,或者如果所有处理程序的回报,那么warn = getOption("warn")值用于确定适当的行动。如果warn是负面的警告被忽略,如果是零,他们都是顶级的功能已完成后,存储和打印;如果它是一个印有发生,因为他们如果是2(或更大)警告变成错误。调用warning(immediate. = TRUE)变成warn <= 0到warn = 1仅此呼叫。
If warn is zero (the default), a read-only variable last.warning is created. It contains the warnings which can be printed via a call to warnings.
如果warn是零(默认),只读变量last.warning创建。它包含可打印调用warnings通过的警告。
Warnings will be truncated to getOption("warning.length") characters, default 1000, indicated by [... truncated].
警告将被截断getOption("warning.length")字符,缺省为1000,表示[... truncated]。
While the warning is being processed, a muffleWarning restart is available. If this restart is invoked with invokeRestart, then warning returns immediately.
虽然正在处理的警告,muffleWarning重新启动。如果在重新启动被调用时,与invokeRestart然后warning立即返回。
An attempt is made to coerce other types of inputs to warning to character vectors.
试图将强迫warning特征向量输入其他类型的。
suppressWarnings evaluates its expression in a context that ignores all warnings.
suppressWarnings评估其表达的情况下,忽略所有警告。
值----------Value----------
The warning message as character string, invisibly.
作为character字符串,无形的警告消息。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
stop for fatal errors, message for diagnostic messages, warnings, and options with argument warn=.
stop致命错误,message诊断消息,warnings,options参数warn=。
gettext for the mechanisms for the automated translation of messages.
gettext自动翻译的消息机制。
举例----------Examples----------
testit <- function() warning("testit")
testit() ## shows call[#显示呼叫]
testit <- function() warning("problem in testit", call. = FALSE)
testit() ## no call[#调用]
suppressWarnings(warning("testit"))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|