
The option fig.retina will only work for HTML documents, and will scale your image such that it will “change the chunk option dpi to dpi * fig.retina, and out.width to fig.width * dpi / fig.retina internally for example, the physical size of an image is doubled and its display size is halved when fig.retina = 2”. What’s more, you can use them alongside fig.width and fig.height to ensure you’ll have utterly no idea what will be produced in the finished product. I also find that out.height actually does nothing in many cases. These out.* can also apply to PDF/ \(\LaTeX\) figures (but I can’t figure out why). There is also out.extra that will apply additional arguments (e.g. css/img styling). The out.width and out.height options are geared toward HTML-based visualization, and are expressed in pixels, or perhaps most usefully, percentages. You also have fig.align with options like ‘left’ and ‘center’, but it apparently has no effect on htmlwidgets and similar packages that rely on other languages like JavaScript. If expressing size in inches doesn’t make sense to you, you can use dpi, which will allow you to know think of dpi*inches as what to expect in terms of pixels. If you supply fig.dim with fig.asp, the latter will be ignored. There is also fig.dim, which will take the two values you would have specified for fig.width and fig.height.
#Rmarkdown cache plus#
You can also supply fig.width plus fig.asp which will produce a height that is fig.width*fig.asp. Furthermore, these settings will not affect interactive and possibly other images in HTML documents except in unexpected ways 9. While you can use them in HTML for static images as those produced by ggplot2, there isn’t a reason I can think of to express the size in inches for an electronic display. Oddly, these are expressed in inches, but at least it is easy enough to manipulate to your liking. For non-HTML, the chunk options of fig.width and fig.height are generally used for figure dimensions.
#Rmarkdown cache pdf#
To begin, there are different systems for PDF or MS Word vs. HTML-based documents. Why you should switch from your current approach.Dynamic data analysis & report generation.> PLEASE do read the posting guide > and provide commented, minimal, self-contained, reproducible code. > R-help using mailing list - To UNSUBSCRIBE and more, see
#Rmarkdown cache manual#
> and relevant parts of the manual to be sure I didn't mess something up and maybe you should look at that and the manual yet another time. I suspect that this is the problem with your inline chunk.


> Specifically, it is advised that "loading packages via library() in a cached chunk and these packages will be used by uncached chunks" is something you should not do. > Caching things that depend on libraries is known to be tricky. > seen this before but a long time ago and dealt with it by deleting the files and cache folders created by the knit. > I think what is happening is some sort of cache corruption presumably caused by the memory demands. > This is not happening for functions like nrow() from base R and it mostly seems to happen to functions from the tidyverse.

> n_distinct(tibDat$ID) : could not find function "n_distinct" > knit is often failing with an error like > What I am finding is that even if one knit has worked fine and I change something somewhere and knit again, the second > There are `r n_distinct(tibDat$ID)` participants and `r nrow(tibDat)` rows of data. > engine is used) working on some large datasets.
#Rmarkdown cache code#
> What is happening is that I have a large (for me, > 3k lines) Rmarkdown file with many R code blocks (no other code or > This question may belong somewhere else, if so, please signpost me and accept apologies. > On Sep 18, 2021, at 12:26 PM, Chris Evans wrote: On Septem10:28:49 AM PDT, "Berry, Charles" wrote: If I want caching, I do it myself (with or without the aid of one of a data caching package). I avoid knitr (Rmarkdown uses knitr) caching like the plague.

Next message (by thread): Cacheing of functions from libraries other than the base in Rmarkdown.Previous message (by thread): Cacheing of functions from libraries other than the base in Rmarkdown.Cacheing of functions from libraries other than the base in Rmarkdown Jeff Newmiller jdnewm|| |rom Sep 19 19:45:03 CEST 2021 Cacheing of functions from libraries other than the base in Rmarkdown
