title: How can I use JavaScript in code chunks of RMarkdown?
body: <p>Inspired by <a href="https://stackoverflow.com/questions/26807477/hyperlinking-within-an-html-presentation-using-r-markdown">this answer</a>, I would like to use for example this dataframe in R</p>
  
  <pre><code>input &lt;- data.frame(text = c("a", "b", "c"), 
                      page_number = c(3, 5, 6))
  </code></pre>
  
  <p>to create a list out of the text, which links to the different page_numbers. The solution describes how to use JavaScript in Markdown but unfortunately not how to use it within code chunks (which is necessary to dynamically create a list).</p>