Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Duncan Murdoch
On 12/03/2018 2:43 PM, Bert Gunter wrote: Please stop this line of queries/"suggestions/speculations and read the relevant docs **carefully**. For example, from ?"==" "Note Do not use == and != for tests, such as in if expressions, where you must get a single TRUE or FALSE. Unless you are

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Bert Gunter
Please stop this line of queries/"suggestions/speculations and read the relevant docs **carefully**. For example, from ?"==" "Note Do not use == and != for tests, such as in if expressions, where you must get a single TRUE or FALSE. Unless you are absolutely sure that nothing unusual can

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Stepan Kasal
Hello, I'm sorry that I aswer to my own mail; I forgot to attach the patch. Patch below, Stepan Kasal On Mon, Mar 12, 2018 at 06:53:00PM +0100, Stepan Kasal wrote: > When thinking about it, stopifnot() should really issue a better error > message in this case. Patch attached. But I should

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread Stepan Kasal
Hello, On Mon, Mar 12, 2018 at 09:30:59AM -0700, William Dunlap wrote: > Why don't you use >stopifnot( all(m1 == m2) ) > ? good question. Even though I use aseert np.all(m1 == m2) when working with NumPy, I got accustomed to the "handy shortcut" that I can omit all() with R vectors and

Re: [R] Bug report: override stopifnot() ?

2018-03-12 Thread William Dunlap via R-help
Why don't you use stopifnot( all(m1 == m2) ) ? Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Mar 12, 2018 at 8:15 AM, Stepan Kasal wrote: > Hello, > I stumbled over a problem: >stopifnot(m1 == m2) > > It works with vector or matrix, but does not work for classes

[R] Bug report: override stopifnot() ?

2018-03-12 Thread Stepan Kasal
Hello, I stumbled over a problem: stopifnot(m1 == m2) It works with vector or matrix, but does not work for classes from Matrix package. In the source of stopifnot(), there is all(m1 == m2) that would just work, but there is also is.logical(m1 == m2) that id FALSE. Would it be possible if