Re: [R] index range

2008-02-18 Thread Ben Bolker
Or see the "Oarray" package (note that's a letter O, not a zero!) Ben Bolker __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provid

Re: [R] index range

2008-02-18 Thread Gabor Grothendieck
On Feb 18, 2008 6:52 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > You can define origin 0 objects yourself if you like. > Here is a partial implementation: > > "[.orig0" <- function(x, i) The 0 should be a 1. >if (is.numeric(i)) .subset(x, i+0) else .subset(x, i) > orig0 <- function(x)

Re: [R] index range

2008-02-18 Thread Gabor Grothendieck
You can define origin 0 objects yourself if you like. Here is a partial implementation: "[.orig0" <- function(x, i) if (is.numeric(i)) .subset(x, i+0) else .subset(x, i) orig0 <- function(x) structure(x, class = c("orig0", setdiff(class(x), "orig0"))) x <- orig0(1:5) x[0:3] # 1:4 Note tha

[R] index range

2008-02-18 Thread hill0093
It looks to me like the index range starts at 1 in R. Is this true? If so, is there a way to change it to start at 0? That way, I wouldn't have to make so many changes when I translate a function from another language. -- View this message in context: http://www.nabble.com/index-range-tp15550797