> "DM" == Duncan Murdoch
> on Sat, 12 Dec 2015 09:05:04 -0500 writes:
DM> On 12/12/2015 8:44 AM, peter dalgaard wrote:
>>
>>> On 12 Dec 2015, at 10:54 , Martin Maechler
>>> wrote:
>>>
>>> My conclusion:
On Sat, Dec 12, 2015 at 1:51 PM, Martin Maechler
wrote:
>> Hadley Wickham
>> on Sat, 12 Dec 2015 08:08:54 -0600 writes:
>
> > On Sat, Dec 12, 2015 at 3:54 AM, Martin Maechler
> > wrote:
>
On 14/12/2015 11:10 AM, Hadley Wickham wrote:
On Sat, Dec 12, 2015 at 1:51 PM, Martin Maechler
wrote:
>> Hadley Wickham
>> on Sat, 12 Dec 2015 08:08:54 -0600 writes:
>
> > On Sat, Dec 12, 2015 at 3:54 AM, Martin Maechler
> >
Hadley wrote
> * all.equal is suboptimal because it returns TRUE or a text string
That feature works ok with stopifnot():
> stopifnot(all.equal("one", 1))
Error: all.equal("one", 1) are not all TRUE
and I suppose stopifnot could be enhanced to print the text strings that
all.equal() returns
On 14/12/2015 11:45 AM, Hadley Wickham wrote:
>> I wonder if R is missing an equality operator for this case. Currently:
>>
>> * == is suboptimal because it's vectorised
>> * all.equal is suboptimal because it returns TRUE or a text string
>> * identical is suboptimal because it doesn't do
>> I wonder if R is missing an equality operator for this case. Currently:
>>
>> * == is suboptimal because it's vectorised
>> * all.equal is suboptimal because it returns TRUE or a text string
>> * identical is suboptimal because it doesn't do common coercions
>>
>> Do we need another function
> as Bill or Jeff explained, "the empty set is always true"
My wording was that any(logical(0)) is FALSE because "there are no
TRUEs in logical(0)".
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Sat, Dec 12, 2015 at 1:54 AM, Martin Maechler
wrote:
>> Henrik
> On 13 Dec 2015, at 20:31 , William Dunlap wrote:
>
>> as Bill or Jeff explained, "the empty set is always true"
>
> My wording was that any(logical(0)) is FALSE because "there are no
> TRUEs in logical(0)".
Yes. My mind still boggles over how the empty set slipped into
> On 12 Dec 2015, at 10:54 , Martin Maechler wrote:
>
> My conclusion: Breaking such a fundamental lemma of logic as
> "the empty set is always true"
Umm, that doesn't make sense to me. Surely you mean that "an AND-operation over
an empty index set is TRUE"? A
> Henrik Bengtsson
> on Fri, 11 Dec 2015 08:20:55 -0800 writes:
> On Fri, Dec 11, 2015 at 8:10 AM, David Winsemius
wrote:
>>
>>> On Dec 11, 2015, at 5:38 AM, Dario Beraldi
wrote:
>>>
On Sat, Dec 12, 2015 at 3:54 AM, Martin Maechler
wrote:
>> Henrik Bengtsson
>> on Fri, 11 Dec 2015 08:20:55 -0800 writes:
>
> > On Fri, Dec 11, 2015 at 8:10 AM, David Winsemius
> wrote:
> >>
>
On 12/12/2015 8:44 AM, peter dalgaard wrote:
On 12 Dec 2015, at 10:54 , Martin Maechler wrote:
My conclusion: Breaking such a fundamental lemma of logic as
"the empty set is always true"
Umm, that doesn't make sense to me. Surely you mean that "an
On Sat, Dec 12, 2015 at 6:08 AM, Hadley Wickham wrote:
> On Sat, Dec 12, 2015 at 3:54 AM, Martin Maechler
> wrote:
>>> Henrik Bengtsson
>>> on Fri, 11 Dec 2015 08:20:55 -0800 writes:
>>
>> > On Fri, Dec
On 12/12/2015 9:08 AM, Hadley Wickham wrote:
On Sat, Dec 12, 2015 at 3:54 AM, Martin Maechler
wrote:
Henrik Bengtsson
on Fri, 11 Dec 2015 08:20:55 -0800 writes:
> On Fri, Dec 11, 2015 at 8:10 AM, David Winsemius
> Hadley Wickham
> on Sat, 12 Dec 2015 08:08:54 -0600 writes:
> On Sat, Dec 12, 2015 at 3:54 AM, Martin Maechler
> wrote:
>>> Henrik Bengtsson on
>>> Fri, 11 Dec 2015 08:20:55 -0800
Hi All,
I'd like to understand the reason why stopifnot(logical(0) == x) doesn't
(never?) throw an exception, at least in these cases:
stopifnot(logical(0) == 1)
stopifnot(logical(0) == TRUE)
stopifnot(logical(0) == FALSE)
My understanding is that logical(0) is an empty set, so I would expect
On Fri, Dec 11, 2015 at 8:10 AM, David Winsemius wrote:
>
>> On Dec 11, 2015, at 5:38 AM, Dario Beraldi wrote:
>>
>> Hi All,
>>
>> I'd like to understand the reason why stopifnot(logical(0) == x) doesn't
>> (never?) throw an exception, at least in
The goal of the comparison operators is to obtain a logical value. Why compare
logical values... you clearly already have that?
stopifnot( logicalvariable ) and
stopifnot( !logicalvariable )
are sensible, but not
stopifnot( logicalvariable == TRUE ) or
stopifnot( logicalvariable == FALSE )
I think the inspection of the "stopifnot()" source code may help.
> stopifnot
function (...)
{
n <- length(ll <- list(...))
if (n == 0L)
return(invisible())
mc <- match.call()
for (i in 1L:n) if (!(is.logical(r <- ll[[i]]) && !anyNA(r) &&
all(r))) {
ch <-
> On Dec 11, 2015, at 5:38 AM, Dario Beraldi wrote:
>
> Hi All,
>
> I'd like to understand the reason why stopifnot(logical(0) == x) doesn't
> (never?) throw an exception, at least in these cases:
The usual way to test for a length-0 logical object is to use length():
The reason is probably that
any(logical())
and
any(!logical())
return FALSE (there are no TRUEs in logical(0)).
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Dec 11, 2015 at 5:38 AM, Dario Beraldi wrote:
> Hi All,
>
> I'd like to understand the reason why
21 matches
Mail list logo