Re: [R] Which data structure in R can mimic hash in PERL best?

From: Leon Yee <>
Date: Tue, 18 Nov 2008 19:45:05 +0800


Hans W. Borchers wrote:

>> Dear all,
>>    Which data structure in R can mimic hash in PERL? I'd like to set
>> up a lookup table, which could be accomplished by HASH if using PERL.
>> Which of the data structures in R is the most efficient for lookup
>> table?
>> Thanks for your help.

> The regular answer to this is "named arrays/vectors" or "environments"
> and has been given several times here on R-help. Unfortunately,
> everybody is applying a different terminology such as 'maps', 'hashes',
> 'tables' or 'dictionaries', etc., so it's difficult to search for those
> entries.

   Thank you all for the help. Actually, I just used named vectors to solve my problem. I am not sure whether there is some difference in efficiency when comparing named vectors/arrays and environments.

Best wishes!
Leon mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 18 Nov 2008 - 11:47:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 18 Nov 2008 - 14:00:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive