Rstudio knit in pdf

The new version of Rstudio (0.98.932) has many new options, including knit in PDF. In the article describing the new version, there is a comment from Dave that says:

... after installing rstudio 0.98.932 I do not get a small drop-down menu for knitting-pdf or words when editing the .Rmd file.

I have the same problem. A helpful answer has been posted:

Maybe either:

a) You are not using R 3.0 (which is required for RMarkdown v2); or

b) You have a custom pointer renderer (markdownToHTML option). You can verify this by doing:

getOption ("rstudio.markdownToHTML")

This solved Dave's problem (b), but when I ran this command I got NULL

> getOption("rstudio.markdownToHTML") NULL 

I assume that I do not have a custom markdown renderer. (I used to do in cusomized .Rprofile , but I deleted it.) My version of R is 3.1.0.

Do I really not get getOption ? Can something else disable my Rstudio?

+6
source share
2 answers

I just installed a new version of RStudio (0.98.932) that prompted me to update a couple of packages (I can’t remember which one, although I can see that I have knitr 1.6, markdown 0.7 and rmarkdown 0.2.46). At first I had the same problem; there was only one β€œknitted” option on the toolbar. I managed to get the option to knit .pdf by adding the following to the header of my .Rmd file.

 --- title: "Sample Document" output: pdf_document --- 

Having done this, I have now discovered that I have a drop-down menu with the ability to knit in HTML, PDF and word. There is also a small gear icon that provides access to R Markdown document options that were not there before. I have no idea what the problem is, but it seems now good!

+7
source

Adding @ nicholas answer That's why I create new .Rmd documents via RStudio gui

File> New File> R markdown.

Therefore, the YAML header is populated correctly.

+1
source

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


All Articles