title: Referencing a table in R markdown with knitr
body: <p>It's possible to reference a figure in <strong>knitr</strong> like that:</p>
  
  <pre><code>```{r myfig}
  plot(1,1)
  ```
  </code></pre>
  
  <p>Figure <code>\ref{fig:myfig}</code> shows ...</p>
  
  <p>The same is not possible for tables, e.g.</p>
  
  <pre><code>```{r my_table, results='markup', fig.cap='capture'}
  tab &lt;- read.table('my_table.txt', sep = '\t')
  kable(tab, 
        format='pandoc', 
        digits = 3, 
        caption =
        "Description")
  ```
  </code></pre>
  
  <p>Table <code>\ref{table:my_table}</code> shows ...</p>
  
  <p>doesn't work! Is it possible to make this work without digging into latex? If no, what would I have to do to make it work?</p>