baggord
November 30, 2020, 8:29am
1
Hi, everyone
I've been trying to convert an RMarkdown file into html and pdf. HTML Conversion works fine and I had a little r code to embed/see an html into the RMarkdown editor using htmltools
library..
When this one line, pandoc process stucks while converting pdf and starts eating more memory every second. It went up to 8.5GB, then I killed the pandoc process.
htmltools::includeHTML("foo.html")
This is a very unrelated code for the pdf of course, and I expect it to just ignore it instead of trying to convert.
I thought this might be useful.
cderv
November 30, 2020, 8:48am
2
Are you inserting into a R code chunk this code ?
You could conditionally ignore this chunk when creating pdf files.
Something like
```{r, eval=knitr::is_html_output()}
See details and more examples here:
This book showcases short, practical examples of lesser-known tips and tricks to helps users get the most out of these tools. After reading this book, you will understand how R Markdown documents are transformed from plain text and how you may...
Hope it helps
1 Like
baggord
November 30, 2020, 9:19am
3
Perfect, thanks. I'm very new to bookdown.
cderv
November 30, 2020, 9:27am
4
This is a Rmarkdown & knitr trick.
I advice you to look into Rmarkdown intro if you are new to this. The books are great ressources
The first official book authored by the core R Markdown developers that provides a comprehensive and accurate reference to the R Markdown ecosystem. With R Markdown, you can easily create reproducible data analysis reports, presentations, dashboards,...
Then if you are interested in bookdown
A guide to authoring books with R Markdown, including how to generate figures and tables, and insert cross-references, citations, HTML widgets, and Shiny apps in R Markdown. The book can be exported to HTML, PDF, and e-books (e.g. EPUB). The...
And the last one above.
1 Like
baggord
November 30, 2020, 9:48am
5
OK, this one is not about the topic, but this limitation is not cool.
@moderators
system
Closed
December 7, 2020, 9:48am
6
This topic was automatically closed 7 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.