title: R - result in array
body: <p>I have following data :</p>
  
  <pre><code>&gt;   Product Location Start_Year WK_156 WK_155 WK_154 WK_153 WK_152 WK_151 WK_150 WK_149 WK_148 WK_147 WK_146
  1  prod a ESK_PARK       2000      0     NA   4578   2926   2641   4900   2256   6652     NA   2112   1902
  2  prod b ESK_PARK       2000      0     NA   4578   2926   2641   4900   2256   6652     NA   2112   1902
  3  prod c ESK_PARK       2000      0     NA     NA   2926   2641   4900   2256   6652     NA   2112   1902
  4  prod d ESK_PARK       2000      0     NA   4578   2926   2641   4900   2256   6652     NA   2112   1902
  </code></pre>
  
  <p>And am trying to loop and store some field in another array/list</p>
  
  <pre><code>for (i in 1:nrow(my.ds)) {
  key[i,] &lt;- my.ds[i,c(1,2)]
  }
  key
  </code></pre>
  
  <p>But here it returns me an error : </p>
  
  <blockquote>
    <p>Error: object 'key' not found</p>
  </blockquote>
  
  <p>How can I create this list?</p>