title: How do I create a copy of a data frame in R
body: <p>I want to duplicate the full contents of a data frame that has been read in from a *.csv file. I don't believe it is a duplication if I do <code>copyOfFirstFrame &lt;- firstFrame</code>. So what do I need to do?</p>
  
  <pre><code>firstFrame &lt;- read_csv("fileName.csv")
  copyOfFirstFrame &lt;- ?????
  </code></pre>
  
  <p>If I do the following the memory address remains the same.</p>
  
  <pre><code>copyOfFirstFrame &lt;- firstFrame
  tracemem(firstFrame) == tracemem(copyOfFirstFrame)
  [1] TRUE
  </code></pre>
  
  <p>The copy must result in two unique memory addresses.  Check <a href="https://stackoverflow.com/questions/7326865/in-r-how-can-i-check-if-two-variable-names-reference-the-same-underlying-object">In R, how can I check if two variable names reference the same underlying object?</a> for details.</p>