Skip to content
Back to formatted view

Raw Message

Message-ID: <419CE03E.7070307@jhsph.edu>
Date: 2004-11-18T17:47:42Z
From: Roger D. Peng
Subject: hashing using named lists
In-Reply-To: <06E6EB1E-397F-11D9-AD4A-000A95764B04@bu.edu>

You could try using environments:

 > e <- new.env(hash = TRUE)
 > e$new <- 1:4
 > ls(e)
[1] "new"
 > e$new
[1] 1 2 3 4
 > e$ne
NULL

-roger

ulas karaoz wrote:
> 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
> 

-- 
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/