title: How do I assign one level deeper in my list?
body: <p>I'd like to assign objects into a list three levels down and it's giving me a hard time with the subscripts.</p>
  <p>This is my code</p>
  <pre><code>    dataset &lt;- iris
      nums &lt;- data.frame(vars = c(&quot;Sepal.Length&quot;, &quot;Petal.Width&quot;))
      l &lt;- list()
      i &lt;- 1
      
      l[[&quot;nums&quot;]][[&quot;visits_d7&quot;]][[&quot;tabSuspectedOutliers&quot;]] &lt;-
          paste0(round(
          sort(as_vector(dataset[
          !is.na(as_vector(dataset[as.character(nums$vars[i])])),
        ][
          scores(as_vector(dataset[as.character(nums$vars[i])])[
            !is.na(as_vector(dataset[as.character(nums$vars[i])]))], 
               type = &quot;iqr&quot;,
               lim = 1.5),
          as.character(nums$vars[i])
        ]))), 
          collapse = &quot;, &quot;)
    
      l[[&quot;nums&quot;]][[as.character(nums$vars[i])]][[&quot;ggHistogram&quot;]] &lt;-
        dataset %&gt;% 
          select(var = nums$vars[i]) %&gt;% 
          ggplot(aes(var)) +
          geom_histogram() 
  </code></pre>
  <p>This gives me the error: Error in <code>*tmp*</code>[[as.character(nums$vars[i])]] : subscript out of bounds</p>