Make a list of lists: L <- list(a = list(a = 1, b = 2), b = list(a = 3, b = 4)) L[["a"]][["b"]] L$a$b
On 1/29/06, Christos Hatzis <[EMAIL PROTECTED]> wrote: > I was wondering if there is an easy way to extend this to implement a 2-D > hash, i.e. 2-way indexing? > > > x[["a"]][["b"]] <- "something" > > Thanks. > > Christos Hatzis > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of jim holtman > Sent: Sunday, January 29, 2006 8:39 PM > To: context grey > Cc: [email protected] > Subject: Re: [R] beginner Q: hashtable or dictionary? > > use a 'list': > > > > x <- list() > > x[['test']] <- 64 > > x[['next one']] <- c(1,2,3,4) > > x > $test > [1] 64 > > $"next one" > [1] 1 2 3 4 > > > x[['test']] > [1] 64 > > > > > > On 1/29/06, context grey <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Is there something like a hashtable or (python) dictionary in R/Splus? > > > > (If not, is there a reason why it's not needed / typical way to > > accomplish the same thing?) > > > > Thank you > > > > ______________________________________________ > > [email protected] mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > > > > > -- > Jim Holtman > Cincinnati, OH > +1 513 247 0281 > > What the problem you are trying to solve? > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] mailing list > https://stat.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://stat.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://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
