5

I'm using R-markdown for a couple of reports. I do it with self contained graphics because I send it via email.

This worked till recently. But now the images are not shown anymore (with the error of a cross in a box). It might be that I updated the Version of RStudio. I used this a the top of the script:

---
title: "blablablab"
author: "blablablab"
output:
html_document:
fig_caption: yes
toc: no
toc_depth: 2
toc_float: no
number_sections: false
self_contained: yes
---

I know that this question is not very specific. I just wanted to ask if there is anybody which also had self contained graphics which suddenly didn't work anymore.

Thanks for the help in advance!

Greetings Dani

Ralf Stubner
  • 26,263
  • 3
  • 40
  • 75
gebizzle
  • 51
  • 1
  • 2
  • Can you please expand your example to include a graphic that is not working for you (e.g. from the default Rmarkdown document created in RStudio) and correct the indentation levels in the YAML headers. This way we get a [mcve] and the question will become quite specific. – Ralf Stubner Jun 19 '18 at 12:12

2 Answers2

5

I just had same problem. In RStudio i had previously:

output:
  html_document:
    self_contained: yes

and it always worked properly producing self-contained HTML. TODAY it stopped working properly. I did update Rstudio a few weeks ago and might not have noticed problem, not sure. SO now i changed to:

output:
  html_document:
    self_contained: yes
    mode: selfcontained

Which seems strange and redundant with two separate lines trying to make things self-contained BUT it worked.

Thomas Guillerme
  • 1,747
  • 4
  • 16
  • 23
Marc Epstein
  • 181
  • 2
  • 4
  • I know this was a long time ago. I would like to be able to post the html on MS teams and get the DT:datatable output to show. I was hoping selfcontained would do it. – Harlan Nelson Mar 25 '21 at 15:46
0

As a sanity check, make sure that you do not have the option include=FALSE in your global chunk options opts_chunk$set

When that is the case, the images are created and stored in the figure-html directory, but not embedded in the html file.

jorvaor
  • 73
  • 1
  • 2
  • 10