[R] error instead of warning?
Duncan Murdoch
murdoch at stats.uwo.ca
Mon Sep 1 02:05:40 CEST 2008
ivo welch wrote:
> dear R experts---is it possible to ask R to abort with an error
> instead of just giving a warning when I am mis-assigning vectors (or
> other data structures) that are not compatible? that is, I would like
>
> 1: In matrix(value, n, p) ... :
> data length [12] is not a sub-multiple or multiple of the number of
> columns [11]
>
> to force an error. are there any other warnings() that are really
> more programming errors that I could also convert into an abort?
>
>
You can convert all warnings to errors using option(warn=2).
Duncan Murdoch
> sincerely,
>
> /iaw
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list