title: Changing column names of a data frame
body: <p>I have a data frame called "newprice" (see below) and I want to change the column names in my program in R.</p>
  
  <pre><code>&gt; newprice
     Chang.  Chang.   Chang.
  1     100       36      136
  2     120      -33       87
  3     150       14      164
  </code></pre>
  
  <p>In fact this is what am doing:</p>
  
  <pre><code>names(newprice)[1]&lt;-paste("premium")
  names(newprice)[2]&lt;-paste("change")
  names(newprice)[3]&lt;-paste("newprice") 
  </code></pre>
  
  <p>I have not put this in a loop because I want each column name to be different as you see.</p>
  
  <p>When I paste my program into R console this is the output it gives me:</p>
  
  <pre><code>&gt; names(newprice)[1]&lt;-paste(“premium”)
  Error: unexpected input in "names(newprice)[1]&lt;-paste(“"
  &gt; names(newprice)[2]&lt;-paste(“change”)
  Error: unexpected input in "names(newprice)[2]&lt;-paste(“"
  &gt; names(newprice)[3]&lt;-paste(“newpremium”)
  Error: unexpected input in "names(newprice)[3]&lt;-paste(“"
  </code></pre>
  
  <p>I have equally tried using the <code>c()</code> function-for example <code>c("premium")</code>, instead of the <code>paste()</code> function, but to no avail.</p>
  
  <p>Could someone help me to figure this out?</p>