Knitr - Indent Change

I am working on a two-column (Rnw, latex) document where the width is. By default, knitr is 4 spaces from code blocks. How to reduce this default indent?

Thank you very much david

+4
source share
1 answer

Or do not reformat the code (use the chunk tidy=FALSE parameter) and manually indent two spaces,

 <<tidy=FALSE>>= if (TRUE) { # code here } @ 

or set R reindent.spaces lower value, for example

 options(reindent.spaces = 2) 

This parameter is passed to the formatR package to reuse your code, and knitr uses formatR to format your default R code.

+3
source

Source: https://habr.com/ru/post/1489859/


All Articles