Re: [R] beginner Q: hashtable or dictionary?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 30 Jan 2006 - 14:32:40 EST

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 <christos@nuverabio.com> 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: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of jim holtman
> Sent: Sunday, January 29, 2006 8:39 PM
> To: context grey
> Cc: r-help@stat.math.ethz.ch
> 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 <mobygeek@yahoo.com> 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
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch 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]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jan 30 14:44:23 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:14 EST