Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Jake Elmstedt
g and even demanding that you explicitly > convert things to a scalar in a context that needs it or to explicitly asking > for recycling when you want it or ... > > > > > -Original Message- > From: R-devel On Behalf Of Henrik Bengtsson > Sent: Friday, Sep

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Avi Gross via R-devel
From: R-devel On Behalf Of Henrik Bengtsson Sent: Friday, September 17, 2021 8:39 AM To: GILLIBERT, Andre Cc: R-devel Subject: Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent) > I’m curious, other than proper programming practice, why? Life's too short for

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Henrik Bengtsson
mits a warning when the condition has length >= 2, > >> because it is often a bug. I would expect a warning or error with > >> set.seed(). > >> > >> Validating inputs and emitting errors early is a good practice. > >> > >> Just my 2 cents. > >

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Duncan Murdoch
ting errors early is a good practice. Just my 2 cents. Sincerely. Andre GILLIBERT -Message d'origine- De : R-devel [mailto:r-devel-boun...@r-project.org] De la part de Avraham Adler Envoyé : vendredi 17 septembre 2021 12:07 À : Henrik Bengtsson Cc : R-devel Objet : Re: [Rd] WISH: set.seed(seed) t

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Henrik Bengtsson
gt; Envoyé : vendredi 17 septembre 2021 12:07 > À : Henrik Bengtsson > Cc : R-devel > Objet : Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 > (now silent) > > Hi, Henrik. > > I’m curious, other than proper programming practice, why? > > Avi >

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread GILLIBERT, Andre
'origine- De : R-devel [mailto:r-devel-boun...@r-project.org] De la part de Avraham Adler Envoyé : vendredi 17 septembre 2021 12:07 À : Henrik Bengtsson Cc : R-devel Objet : Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent) Hi, Henrik. I’m curious, other than pr

Re: [Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Avraham Adler
Hi, Henrik. I’m curious, other than proper programming practice, why? Avi On Fri, Sep 17, 2021 at 11:48 AM Henrik Bengtsson < henrik.bengts...@gmail.com> wrote: > Hi, > > according to help("set.seed"), argument 'seed' to set.seed() should be: > > a single value, interpreted as an integer, or

[Rd] WISH: set.seed(seed) to produce error if length(seed) != 1 (now silent)

2021-09-17 Thread Henrik Bengtsson
Hi, according to help("set.seed"), argument 'seed' to set.seed() should be: a single value, interpreted as an integer, or NULL (see ‘Details’). >From code inspection (src/main/RNG.c) and testing, it turns out that if you pass a 'seed' with length greater than one, it silently uses seed[1],