According to the documentation the default for fig.retina in knitr is a numeric value of 1. I would expect, then, leaving the setting blank (example 1 below) would yield exactly the same image as in example 2 below where I specify fig.retina=1. Instead I'm finding that the default (#1) creates an image that is 60kb and setting fig.retina=1 yields an image that is 25kb.
Perhaps explicitly setting fig.retina overrides other settings or something? Does anyone have an explanation for why leaving the chunk options blank results is a figure that is more than twice the size as setting fig.retina=1 (which should be the default)?
---
title: "Untitled"
output:
html_document:
self_contained: false
---
```{r onefile_figretinaDefault}
#1. this is 60kb on disk
library(ggplot2)
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretina1, fig.retina=1 }
#2. this is 25kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretina2, fig.retina=2 }
#3. this is 60kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretinaNULL, fig.retina=NULL}
#4. this is 25kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```
```{r onefile_figretina1_owNULL, out.width = NULL, fig.retina=1 }
#5. this is 25kb on disk
ggplot(cars, aes(speed, dist)) + geom_point()
```