[R] hashing using named lists

Huntsinger, Reid reid_huntsinger at merck.com
Thu Nov 18 19:14:54 CET 2004


It seems that that behavior is hard-coded in the subscript code, 
but I bet you could fix it easily by changing the call to get1index

 offset = get1index(CAR(subs), getAttrib(x, R_NamesSymbol),
                           length(x), /*partial ok*/TRUE, i);

in src/main/subset.c (line 762 I think, R-2.0.0) to supply FALSE in place of
TRUE and recompiling... I haven't tried yet though so maybe I'm quite badly
wrong.

Reid Huntsinger 

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of ulas karaoz
Sent: Thursday, November 18, 2004 11:30 AM
To: r-help at stat.math.ethz.ch
Subject: [R] hashing using named lists


hi all,
I am trying to use named list to hash a bunch of vector by name, for 
instance:
test = list()
test$name = c(1,2,3)

the problem is that when i try to get the values back by using the 
name, the matching isn't done in an exact way, so
test$na is not NULL.

is there a way around this?
Why by default all.equal.list doesnt require an exact match?
How can I do hashing in R?

thanks.
ulas.

______________________________________________
R-help at 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




More information about the R-help mailing list