title: Accessing values from prop.table() in R
body: <p>I have a probability table as follows:</p>
  
  <pre><code>prop.table(table(h[[10]]))
  
           1         12         15         16          3          9 
  0.20000000 0.30000000 0.10000000 0.13333333 0.20000000 0.06666667 
  </code></pre>
  
  <p>I then converted it to matrix using:</p>
  
  <pre><code>probData &lt;- data.matrix(prop.table(table(h[[10]])))
  </code></pre>
  
  <p>Now I need to run the condition such as:</p>
  
  <pre><code>if (probData[row,column] &gt; 0.2){
  
    print(print name of that column eg 1,12,15,16)  
  
  }
  </code></pre>
  
  <p>probData[row,column] gives me the probability.The problem is I am not able to access the column names (1,12,15,16) from their respective probabilities.
  Any help is appreciated. </p>