title: Referring to variables by column names
body: <p>I have a matrix, say <code>X</code>, whose columns I need to use in R. I named each column using the <code>colnames</code> command. However, when I type the name of a column, nothing comes up. To illustrate, I used a code like the one below:</p>
  
  <pre><code>colnames(X) &lt;- c("column1","column2")
  </code></pre>
  
  <p>When I type <code>X</code>, <code>column1</code> and <code>column2</code> appear at the top of the columns. However, when I type <code>column1</code> or <code>column2</code>, they cannot be found. </p>
  
  <p>Does anyone know what needs to be done? </p>