I want to make the matrix to be indexed from row (column) 0, not 1 Can I do that? How? Thanks
Hi, You can do it, but it would be very difficult (think reworking all indexing yourself) and you probably should not even try (nothing else that was expecting indexing to work as the R gods intended it to would work once you had done your rework). What has lead you to want to index from 0? If it is some problem you are having, I can almost certainly promise you it will be easier for us to show you how to approach it differently and index from 1 than to change the underlying framework so you can index from 0. Cheers, Josh On Mon, Nov 22, 2010 at 10:23 AM, bogdanno <bodinsoul at gmail.com> wrote:> > I want to make the matrix to be indexed from row (column) 0, not 1 > Can I do that? How? > Thanks > > ______________________________________________ > R-help at 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 provide commented, minimal, self-contained, reproducible code.-- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/
Eh??? Why would you want to do that?? (R isn't C). So the simple answer is: you can't. The other answer is, well of course you sort of can via, e.g. for(i in 0:9) { z <- myMatrix[i+1,] ... } But as Josh said, I think this falls into the class of "You are just asking for trouble, so don't do it." Cheers, Bert On Mon, Nov 22, 2010 at 10:23 AM, bogdanno <bodinsoul at gmail.com> wrote:> I want to make the matrix to be indexed from row (column) 0, not 1 > Can I do that? How? > Thanks > > ______________________________________________ > R-help at 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 provide commented, minimal, self-contained, reproducible code. >-- Bert Gunter Genentech Nonclinical Biostatistics
David Stoffer
2010-Nov-23 04:29 UTC
[R] Is it possible to make a matrix to start at row 0?
bogdanno-2 wrote:> > I want to make the matrix to be indexed from row (column) 0, not 1 > Can I do that? How? > Thanks > > ______________________________________________ > R-help at 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 provide commented, minimal, self-contained, reproducible code. > >Try the Oarray package... it did have some problems at one time, but maybe it has been updated since then. -- View this message in context: http://r.789695.n4.nabble.com/Is-it-possible-to-make-a-matrix-to-start-at-row-0-tp3054248p3054829.html Sent from the R help mailing list archive at Nabble.com.