From jori@mey@ @ending from gm@il@com  Thu Aug 30 18:24:02 2018
From: jori@mey@ @ending from gm@il@com (Joris Meys)
Date: Thu, 30 Aug 2018 18:24:02 +0200
Subject: [Rd] ROBUSTNESS: x || y and x && y to give warning/error if
 length(x) != 1 or length(y) != 1
In-Reply-To: <23432.5145.624837.968060@stat.math.ethz.ch>
References: <CAFDcVCSEqHvfhD358GD3Fgz6FjuOiMiYHswz+pyTnAEoV0CyZw@mail.gmail.com>
 <CAO1zAVaCyKOQLFi2161PB3ycHbr72ue3EtTa189Lz-C+rO1_0w@mail.gmail.com>
 <c5c5721f-65fb-39f0-c7e9-77bb413fbb03@kogentum.hu>
 <CAO1zAVYgQyKP3AbyB_AdTPKogWGQs=cC+YaTtLuG2OSahzvrVA@mail.gmail.com>
 <23432.5145.624837.968060@stat.math.ethz.ch>
Message-ID: <CAO1zAVbp4f9Hv1dMrqLy0LQCkirUFKTdmTp6-UHROQy51avRyw@mail.gmail.com>

On Thu, Aug 30, 2018 at 5:58 PM Martin Maechler <maechler at stat.math.ethz.ch>
wrote:

>
> I agree "in theory".
> Thank you, Henrik, for bringing it up!
>
> In practice I think we should start having a warning signalled.
>

I agree. I wouldn't know who would count on the automatic selection of the
first value, but better safe than sorry.


> I have checked the source code in the mean time, and the check
> is really very cheap
> { because it can/should be done after checking isNumber(): so
>   then we know we have an atomic and can use XLENGTH() }
>
>
That was my idea as well after going through the source code. I didn't want
to state it as I don't know enough of the code base and couldn't see if
there were complications I missed. Thank you for confirming!

Cheers
Joris
-- 
Joris Meys
Statistical consultant

Department of Data Analysis and Mathematical Modelling
Ghent University
Coupure Links 653, B-9000 Gent (Belgium)
<https://maps.google.com/?q=Coupure+links+653,%C2%A0B-9000+Gent,%C2%A0Belgium&entry=gmail&source=g>

-----------
Biowiskundedagen 2017-2018
http://www.biowiskundedagen.ugent.be/

-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

	[[alternative HTML version deleted]]



[Rd] ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1
Joris Meys