Problems with RMarkdown HTMLWidgets

A short description of the post.

Rodney Dyer https://dyerlab.org (Center for Environmental Studies)https://ces.vcu.edu
2021-03-16

OK, so in working on various RMarkdown stuff, I‘ve just run across a problem with it no longer rendering HTMLWidget stuff in the recent upgrade. So if you use something like mermaid or leaflet in your xaringan presentation, it will show you the raw

<div></div>

output instead of the actual widget. This is not an easy one to track down online because the RMarkdown & Xaringan Github sites do not address it. So I thought I would insert a thing here so I can find it next time I need it.

As it turns out, we need to set an option in the setup chunck as follows:

options(htmltools.preserve.raw = FALSE)

This will fix things until RStudio fixes the markdown problems and the world can get back to normal.

Citation

For attribution, please cite this work as

Dyer (2021, March 16). The Dyer Laboratory: Problems with RMarkdown HTMLWidgets. Retrieved from https://dyerlab.github.io/DLabWebsite/posts/2021-03-16-problems-with-rmarkdown-htmlwidgets/

BibTeX citation

@misc{dyer2021problems,
  author = {Dyer, Rodney},
  title = {The Dyer Laboratory: Problems with RMarkdown HTMLWidgets},
  url = {https://dyerlab.github.io/DLabWebsite/posts/2021-03-16-problems-with-rmarkdown-htmlwidgets/},
  year = {2021}
}