title: Insert a value in a linked-list
body: <p>I'm trying to implement a linked list in R. I can easily add at the end and remove the values anywhere but I don't know how can I insert a value after or before another value ? Look at my code:  </p>
  
  <pre><code>lis &lt;- list()  
  lis &lt;- c(lis, (rnorm(1000000, mean = 30, sd=8)))    
  
  lis[[170000]] &lt;- 32   #add (replace) why??? this is my problem  
  lis[[1000001]] &lt;- 30  #add at the end  
  
  lis &lt;- lis[-880987]   #remove   
  lis &lt;- lis[-1000001]  #remove
  </code></pre>