Re: [Rd] NROW and NCOL on NULL

2024-02-06 Thread Simone Giannerini
I just saw this r85704 | hornik | 2023-12-19 00:33:07 -0600 (Tue, 19 Dec 2023) | 1 line Changed paths: M /trunk/doc/NEWS.Rd M /trunk/src/library/base/R/matrix.R M /trunk/src/library/base/man/nrow.Rd M

Re: [Rd] NROW and NCOL on NULL

2023-09-25 Thread Martin Maechler
> Simone Giannerini > on Sun, 24 Sep 2023 16:57:00 +0200 writes: > Thank you for your comment, On Sat, Sep 23, 2023 at > 9:51 PM Ben Bolker wrote: >> >> This is certainly worth discussing, but there's always a >> heavy burden of back-compatibility; how much

Re: [Rd] NROW and NCOL on NULL

2023-09-24 Thread Simone Giannerini
Thank you for your comment, On Sat, Sep 23, 2023 at 9:51 PM Ben Bolker wrote: > > This is certainly worth discussing, but there's always a heavy > burden of back-compatibility; how much better would it be for NCOL and > NROW to both return zero, vs. the amount of old code that would be

Re: [Rd] NROW and NCOL on NULL

2023-09-23 Thread Duncan Murdoch
On 23/09/2023 3:41 p.m., Simone Giannerini wrote: I know it's documented and I know there are other ways to guard against this behaviour, once you know about this. The point is whether it might be worth it to make NCOL and NROW return the same value on NULL and make R more consistent/intuitive

Re: [Rd] NROW and NCOL on NULL

2023-09-23 Thread Rui Barradas
Às 20:41 de 23/09/2023, Simone Giannerini escreveu: I know it's documented and I know there are other ways to guard against this behaviour, once you know about this. The point is whether it might be worth it to make NCOL and NROW return the same value on NULL and make R more consistent/intuitive

Re: [Rd] NROW and NCOL on NULL

2023-09-23 Thread Ben Bolker
This is certainly worth discussing, but there's always a heavy burden of back-compatibility; how much better would it be for NCOL and NROW to both return zero, vs. the amount of old code that would be broken? Furthermore, the reason for this behaviour is justified as consistency with the

Re: [Rd] NROW and NCOL on NULL

2023-09-23 Thread Simone Giannerini
I know it's documented and I know there are other ways to guard against this behaviour, once you know about this. The point is whether it might be worth it to make NCOL and NROW return the same value on NULL and make R more consistent/intuitive and possibly less error prone. Regards, Simone On

Re: [Rd] NROW and NCOL on NULL

2023-09-23 Thread Duncan Murdoch
It's been documented for a long time that NCOL(NULL) is 1. What particular problems did you have in mind? There might be other ways to guard against them. Duncan Murdoch On 23/09/2023 1:43 p.m., Simone Giannerini wrote: Dear list, I do not know what would be the 'correct' answer to the

[Rd] NROW and NCOL on NULL

2023-09-23 Thread Simone Giannerini
Dear list, I do not know what would be the 'correct' answer to the following but I think that they should return the same value to avoid potential problems and hard to debug errors. Regards, Simone --- > NCOL(NULL) [1] 1 > NROW(NULL) [1] 0 > sessionInfo()