title: When I try to iterate through a row of a dataframe in R and put the values in a vector, the values end up changing. What is causing that?
body: <p>I want to iterate through a dataframe in R and put each value in a separate numeric vector. As you can see, in the original dataframe (called singaporeINF, see the first photo), the values are all between 3000 and 4000.</p>
  
  <p><img src="https://i.stack.imgur.com/QCzyz.png" alt="The dataframe I am trying to get the values from, singaporeINF"></p>
  
  <p>However, when I iterate and extract the values using the code below:</p>
  
  <pre><code>singaporeVector &lt;- numeric()
  for (i in singaporeINF){
    singaporeVector &lt;- append(singaporeVector, i)
  }
  print(singaporeVector)
  </code></pre>
  
  <p>I end up with this output:</p>
  
  <pre><code>[1] 10  8  8  8  8  8  7  8
  </code></pre>
  
  <p>What is happening? Why do the values change from 3000 to 10 or 8?</p>
  
  <p><img src="https://i.stack.imgur.com/MKr8B.png" alt="Output"></p>