Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML outputs are different between using knitr in Rstudio & knit2html in command line

Tags:

r

rstudio

knitr

I am trying to generate html documents from R markdown files using knitr.

When I use the knit html button in R studio it works fine and it gets me the desired output.

However when I use knit2html() in the commandline, the formatting of the output html is different (less prettier) than that obtained from rstudio.

Can you tell me what are the exact options and functions that are being used when I press the knit html button?

I wanted to include images, but apparently my "reputation" is too low...

Basically, the major difference are :

1) code chunks and outputs have smoother edges

2) header is included.

3) Font sizes

like image 542
Jinhyun Ju Avatar asked Aug 29 '14 20:08

Jinhyun Ju


Video Answer


1 Answers

Now RStudio uses R Markdown v2 by default, and knitr::knit2html() still uses R Markdown v1. V2 uses Pandoc and Twitter Bootstrap themes, which are prettier than the style in v1.

like image 150
Yihui Xie Avatar answered Sep 28 '22 03:09

Yihui Xie