equivalent of a python dict in R

前端 未结 3 666
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 00:46

I want to make the equivalent of a python dict in R. Basically, in python I have:

visited = {}

if atom_count not in visited:
  Do stuff
  visited[atom_count] =          


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 01:37

    I believe that the use of a hash table (creating a new environment) may be the solution to your problem. I'd type out how to do this but I just did so yesterday day at talkstats.com.

    If your dictionary is large and only two columns then this may be the way to go. Here's the link to the talkstats thread with sample R code:

    HASH TABLE LINK

提交回复
热议问题