Standard R vectors and list elements can given names, and can be accessed by 
them.  This allows them to be used like the dictionaries or hashes of other 
languages.

For example

>  x = c("a"=1, "b"=2, "c"=3)
>  x["a"]
a 
1 
> x["foo"] = "bar"
> x["foo"]
  foo 
"bar" 
> x
    a     b     c   foo 
  "1"   "2"   "3" "bar" 

-Greg

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of context grey
> Sent: Sunday, January 29, 2006 8:35 PM
> To: [email protected]
> Subject: [R] beginner Q: hashtable or dictionary?
> 
> 
> 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
> 
----------------------------------------------------------------------
LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}

______________________________________________
[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

Reply via email to