The new version of Rstudio (0.98.932) has many new options including knit to PDF. An article describing the new version has a comment from Dave that says:
...after installing rstudio 0.98.932 I don’t get the little dropdown menu for knit-pdf or word when editing a .Rmd file.
I'm having the same issue. A helpful response was posted:
It might be that either:
a) You are not running R 3.0 (which is required for RMarkdown v2); or
b) You have a custom markdown renderer defined (markdownToHTML option). You can check for this by executing:
getOption(“rstudio.markdownToHTML”)
That solved Dave's problem (b), but when I run that command I get NULL
> getOption("rstudio.markdownToHTML")
NULL
Which I assume means I don't have a custom markdown renderer defined. (Previously I did in a cusomized .Rprofile
, but I removed that.) My R version is 3.1.0.
Am I misunderstanding the getOption
command? Could something else be tripping up my Rstudio?
To transform your markdown file into an HTML, PDF, or Word document, click the “Knit” icon that appears above your file in the scripts editor. A drop down menu will let you select the type of output that you want. When you click the button, rmarkdown will duplicate your text in the new file format.
Just focus the window containing your markdown file and use the convert command ( Packages > Markdown to PDF > Convert ) or with the following shortcut ctrl-alt-e . The output PDF will be styled similar to the markdown on github.com .
If you are using RStudio, then the “Knit” button (Ctrl+Shift+K) will render the document and display a preview of it. Note that both methods use the same mechanism; RStudio's “Knit” button calls rmarkdown::render() under the hood.
To knit in RStudio , click the Knit pull down button. You want to use the Knit HTML option for this lesson. When you click the Knit HTML button, a window will open in your console titled R Markdown. This pane shows the knitting progress.
I have just installed the new version of RStudio (0.98.932), which prompted me to upgrade a couple of packages (I can't remember which, although I see I have knitr 1.6, markdown 0.7 and rmarkdown 0.2.46). At first I had the same problem; there was only a single 'knit' option on the tool bar. I managed to get the ability to knit to .pdf by adding the following to the head of my .Rmd file.
---
title: "Sample Document"
output: pdf_document
---
Having done that, I now find I do have a drop down menu with options to knit to HTML, PDF and word. There's also a little gear icon that provides access to the R Markdown document options that wasn't there before. I have no idea what the problem was but it seems OK now!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With