[R] handling warning messages
ronggui
ronggui.huang at gmail.com
Thu Mar 16 08:57:03 CET 2006
see ?options
'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-level function
returns. If fewer than 10 warnings were signalled they will
be printed otherwise a message saying how many (max 50) were
signalled. A top-level variable called 'last.warning' is
created and can be viewed through the function 'warnings'.
If 'warn' is one, warnings are printed as they occur. If
'warn' is two or larger all warnings are turned into errors.
'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
'warn'.
'warnings.length': sets the truncation limit for error and warning
messages. A non-negative integer, with allowed values
100...8192, default 1000.
2006/3/16, Sigal Blay <sblay at sfu.ca>:
> Is there any way to store the value of warnings but avoid printing them?
>
> A simplified example:
> > out <- c(0.2,0.3,0.4)
> > var <- c(2,3,4)
> > outcome <- glm(out ~ var, family=binomial())
> Warning message:
> non-integer #successes in a binomial glm! in: eval(expr, envir, enclos)
>
> I don't like the warning printed,
> but I would like to be able to check it's value after the top-level function
> has completed and than decide weather to print it or not.
>
> Thanks,
>
> Sigal Blay
> Statistical Genetics Working Group
> Department of Statistics and Actuarial Science
> Simon Fraser University
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
--
»ÆÈÙ¹ó
Deparment of Sociology
Fudan University
More information about the R-help
mailing list