✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Plotly graph into PDF markdown

Hi there,

I am trying to knit a rmarkdown document into PDF but I get this error message :

Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:

  always_allow_html: yes

but when I add this option into the YAML nothing change.

output:

  pdf_document:
  always_allow_html: yes

I still get the same error. Is there a way to use plot_ly and knit the graph into PDF ?

Here is my code :

``` {r,echo=FALSE, fig.height=4.3 , fig.width=8, error=FALSE, warning=FALSE, message=FALSE}
library(plotly)

plot_ly(x=GDP_CAN$Annee,y=GDP_CAN$Valeurs,type="l")
layout(xaxis=list(title="Année"),yaxis=list(title="Dollard US / Capital")) ```

https://stackoverflow.com/questions/42543206/r-markdown-compile-error