On 31 Mar 2004 at 14:38, Barry Rowlingson wrote: > Gabor Grothendieck wrote: > > If you are willing to do it yourself you can define a class > > for which indexing behaves that way. > > I'd like to prefix all these solutions with "Here's how to do it, > but > don't actually do it you crazy fool". It's on a par with redefining > pi, or redefining '+'. And then redefining '<-'.
You mean > y <- 5 > "<-" <- function(x,value) x+value > y [1] 5 > y <- 5 [1] 10 (but remember not to save the workspace) > > These techniques have their proper place, and that would be in the > currently non-existent obfuscated R contest. > > No, the R-ish (iRish?) way is to index vectors from 1. That's what > the > R gods intended! But not everybody listens to the gods! On CRAN there is a blasfemish package called Oarray Kjetil Halvorsen > > > Baz > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html