How to embed a dynamic plot generated with R Markdown into Outlook email?

I am trying to embed an html file produced from R Markdown into the outlook email. I can do it by choosing Insert/Insert as Text, but it only shows texts and static charts. As an example, it shows all contents except the dygraphs plot.

I am thankful if anyone knows how to embed htmlwidgets such as Plotly, dygraphs, etc. into an outlook email. Please find below R markdown scripts along with what email shows.



title: "Outlook"
date: "10/5/2022"
output: html_document

knitr::opts_chunk$set(echo = TRUE)

Including Static Plot

This is an R Markdown document.

plot(pressure)

Including dynamic Plot

You can also embed dynamic plots, for example:

library(dygraphs)
lungDeaths <- cbind(mdeaths, fdeaths)
dygraph(lungDeaths)

.

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.

Usually you can't send any HTML content by email. HTML produce by the html_document format are full feature HTML with some CSS and JS content that you can't have in an email.

I would use specific format like

Or just add your self contained html to attachement in the email (with a simple blastula Rmd created content)

1 Like

Thank you for your response.

1 Like