How to include JS file into rmarkdown file?

I would like to include Javascript from Flourish visualization in rmarkdown file.

You can insert JS code in a R Markdown document using a js engine like in this example

Otherwise, you can use includes to insert code in the HTML templates

But usually, JS library to be used in Shiny apps or HTML R Markdown are packaged as htmlwidgets or HTML dependencies with htmltools. See more at

You can then package this JS library in a R package to share its usage across document and users for examples

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.