R tip #4: R Markdown: how to get separate image files from html output

One annoyance of html creation from R Markdown is that by default, one gets inline html images. This may seem advantageous – it leads to a single html file. But this leads to a very large html file. Also, one doesn’t have access to the images directly.

Having an html file with separated images is the standard way of doing things. Also, you often want the actual image files for use in presentations or to pass to a colleague or other needs.

Here is a sample header (note yaml format) necessary to force Rmarkdown to produce an html file that has a separate file of images. Note that the “self-contained” is the key part – and the spacing may also be important.

title: "MarkBieda_RLEARN1_RmdWordpressv05"
author: "markb"
date: "December 12, 2016"
    self_contained: no

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s