Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread avi.e.gross
Hans, It is a good question albeit R made a conscious decision to have indices that correspond to things like row numbers and thus start with 1. Some others have used a start of zero but often for reasons more related to making use of all combinations of the implementation of integers on many

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Ben Bolker
Also https://cran.r-project.org/package=Oarray (which is older and hence possibly more stable) On 2024-04-21 3:55 a.m., Hans W wrote: As we all know, in R indices for vectors start with 1, i.e, x[0] is not a correct expression. Some algorithms, e.g. in graph theory or combinatorics, are much

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Ben Bolker
https://cran.r-project.org/package=index0 On Sun, Apr 21, 2024, 3:56 AM Hans W wrote: > As we all know, in R indices for vectors start with 1, i.e, x[0] is not a > correct expression. Some algorithms, e.g. in graph theory or combinatorics, > are much easier to formulate and code if 0 is an

Re: [R] passing a modified argument to an S3 method

2024-04-21 Thread CRAN.r via R-help
I've got a complicated default value for an argument, basically a "control" argument that's a list with a lot of defaults, and I want to figure out its value before dispatching to a method so I don't need to have the same code repeated at the beginning of every method. None of the default

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Rui Barradas
Às 09:08 de 21/04/2024, Rui Barradas escreveu: Às 08:55 de 21/04/2024, Hans W escreveu: As we all know, in R indices for vectors start with 1, i.e, x[0] is not a correct expression. Some algorithms, e.g. in graph theory or combinatorics, are much easier to formulate and code if 0 is an allowed

Re: [R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Rui Barradas
Às 08:55 de 21/04/2024, Hans W escreveu: As we all know, in R indices for vectors start with 1, i.e, x[0] is not a correct expression. Some algorithms, e.g. in graph theory or combinatorics, are much easier to formulate and code if 0 is an allowed index pointing to the first element of the

[R] x[0]: Can '0' be made an allowed index in R?

2024-04-21 Thread Hans W
As we all know, in R indices for vectors start with 1, i.e, x[0] is not a correct expression. Some algorithms, e.g. in graph theory or combinatorics, are much easier to formulate and code if 0 is an allowed index pointing to the first element of the vector. Some programming languages, for