title: data structure to check if list contains an element in constant time in R
body: <p>I am looking for data structure to check if a name is contained in a list in constant time. Currently I am doing this, but it probably takes O(N) complexity.</p>
  
  <pre><code>&gt; l = read.csv("test.csv")[,1]   # reads a long list of names
  &gt; if (x %in% l) { ... }        # check if it contains a name, takes O(N) time
  </code></pre>