Hi, I was wondering if anyone has played around this this package called "rdict"? It attempts to implement a hash table in R using skip lists. Just came across it while trying to look for simpler text manipulation methods: http://userprimary.net/posts/2010/05/29/rdict-skip-list-hash-table-for-R/ Cheers, Paul [[alternative HTML version deleted]]
Paul -
You can also use named vectors as something similar to
a python dictionary:
> nvec = c('one'=20,'two'=30,'three'=40)
> nvec['four'] = 50
> nvec['one']
one
20> nvec['four']
four
50
Although the result is named, it can be used as a regular R
value:
> 20 + nvec['three']
three
60
If the names annoy you (as they seem to annoy many R users),
you can unname the object:
> unname(20 + nvec['three'])
[1] 60
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
spector at stat.berkeley.edu
On Wed, 22 Dec 2010, Paul Rigor wrote:
> Hi,
>
> I was wondering if anyone has played around this this package called
> "rdict"? It attempts to implement a hash table in R using skip
lists. Just
> came across it while trying to look for simpler text manipulation methods:
>
> http://userprimary.net/posts/2010/05/29/rdict-skip-list-hash-table-for-R/
>
> Cheers,
> Paul
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
On 12/22/2010 05:49 PM, Paul Rigor wrote:> Hi, > > I was wondering if anyone has played around this this package called > "rdict"? It attempts to implement a hash table in R using skip lists. Just > came across it while trying to look for simpler text manipulation methods: > > http://userprimary.net/posts/2010/05/29/rdict-skip-list-hash-table-for-R/kind of an odd question, so kind of an odd answer. I'd say this was an implementation of skip lists in C with an R interface. An example of a data structure implementation in R is Matloff's binary tree http://tolstoy.newcastle.edu.au/R/e12/help/10/10/0519.html which is perhaps more helpful for understanding the opportunities and limitations of the R language per se. Martin> > Cheers, > Paul > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793