We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Sebastian Mazani • 9 years ago

Hie there. I just downloaded RStudio and was just learning the environment. I mistakenly deleted a file that was linked to the Rmarkdown and the Rmarkdown screen within RStudio was erased. I failed to recover the same. I deleted the RStudio I had loaded from my program files and reloaded the RStudio again. Unfortunately, I am still getting the same result-NO Rmarkdown screen in RSudio.
Can someone please help?

Regards

Sebastian-Zimbabwe

Heshmat Seyyedi • 9 years ago

I have a problem with even opening rmarkdown session in RStudio, it's the latest version of RStudio I'm using now. However, when I want to open new rmakrdown file, it requires me to agree to get the updated version, & after that it throws the error:
Error in setwd(exdir) : cannot change working directory

Also, when I open an already existed rmarkdown file, when I want to publish it to pdf or html file, I have the same proble.
I googled a lot; but really didn't find help. I also, even, re-installed both R & RStuido.

annoporci • 9 years ago

Error in setwd(exdir)

This is either because the directory you
are trying to set as working directory does not exist (change the
directory structure you invoke to fix this) or because of permission
problems. Windows has a lot of permission issues (google "take
ownership" registry modifications for a solution), but never hit the
problem with Linux or Mac OS. Could be something else, but check these
two.

Santana • 7 years ago

install the package manually in the console entering:

install.packages("rmarkdown")

slowpoke000 • 7 years ago

What was the fix to the problem? I got a new laptop and have to re-install everything ad am encountering the same error. Rstudio throw an error to install markdown file and nothing happened. I tried to manually install the markdown file but it didn't work. I could't create any new markdown file or knit exiting markdown files .

SergeyMastitsky • 10 years ago

Wow! Interactive presentations with Shiny - the dreams come true! Thank you so much, guys!

Morgan • 9 years ago

Can someone post a minimal example of how to have a single page in an rmarkdown to pdf document have a landscape layout and the rest portrait? I've tried several ways with no luck. If there is a pure markdown option that would be even better than using latex...any help is much appreciated!!!
output:
pdf_document:
classoption: landscape
and also tried
includes:
in_header: header.tex which has the latex packages i need to include.

and with these i tried
\begin{landscape}
```{r,echo=F}
print(some_dataframe)
```
\end{landscape

LucasMation • 9 years ago

That is great, thanks. I could not find out how to I embed (import) an eps image (generated in another Software) into the markdown document and knit into pdf. I tryed "\includegraphics[scale=0.29]{densidade.eps}" but got error: "LaTeX Error: Unknown graphics extension: .eps"

Klasicm • 8 years ago

Hi All: I'm new to R Markdown, so apologies for the basic question. I am creating a doc with output ioslides. I'd like to change just the background color of my first slide to blue. I can't for the life of me figure out how to do it. Any advice is much appreciated! TIA!

Olivier Devineau • 9 years ago

I feel I am about to drop LaTeX in favor of R markdown for presentations... I have a small question though. What are the main differences between using R markdown and "knitring" to ioslides/reveal, and using the built-in presentation feature in RStudio? I guess they are related but it seems the mardown syntax (and use of YAML header) is somewhat different... Could someone enlighten me about this?

jjallaire • 9 years ago

They are similar, the "R Presentations" feature is better if you plan on delivering presentations within the IDE (i.e. the slides appear in the top right panel and are occasionally zoomed). R Markdown presentations are better if you like the asthetics of iosldides better and/or if you want to support Beamer output.

Angelo Nardone • 9 years ago

I just installe the new version of of R-studio and when I try to "knit" a RMD file (it was working fine previous to the update) I get the following message: Install Required Package Rendering R Markdown documents requires an updated version of the rmarkdown package. Do you want to install this package now? I have a Mac (yosemite) and even tough I click install nothing happens, it gives me the path to the "downloaded" fiel, but that directory does NOT exist. (The downloaded binary packages are in

/var/folders/2y/nvbqm6lx1xd0lwkv5g63mmbc0000gn/T//RtmpoXNGtC/downloaded_packages)

How can I install this package manually? And also I'm getting an error with pdfLaTex it cannot find it (or is not installed).

Charles V Brown Jr • 9 years ago

What version number of RStudio did you install?

Angelo Nardone • 9 years ago

Version 0.98.1102

Ian Pylvainen • 9 years ago

Can you try installing the R Markdown package from CRAN using the command install.packages("rmarkdown") and let us know if that works for you?

Angelo Nardone • 9 years ago

Didn't work.
I had to reinstall ALL the packages and with that it got fixed.
Thanks

tom_s • 9 years ago

This happened to me as well - I did a full reinstall and it didn't work. Any suggestions?

EDIT: I fixed it by installing rmarkdown from github. nfi why this works and the other way doesn't :)
devtools::install_github("rstudio/rmarkdown")

Diego-MX • 9 years ago

I had all these failing. devtools::install_github("rstudio/rmarkdown") as well. Apparently a problem of devtools in Ubuntu 14.10, or whatnot.

My fix was to use the git command. devtools::install_git("git://github.com/rstudio/rm...")

fritsch • 9 years ago

Hi,

how do I pass R LaTeX output through markdown? You'd think results="asis" would do the trick but apparently "asis" means something else in markdown-land :)

In my case I use print(ols.f,latex=TRUE) to print the output of an rms model and it results in interpreted LaTeX code like the following in the final output:

\textbackslash{}centerline\{

Funny enough not everything is changed but only parts.

So how do I tell RMarkdown to leave the chunk results alone?

Thx
Stefan

(I think I posted a similar question once already, but I can no longer find it :( )

Simon Garnier • 9 years ago

In case some of you are interested, I've started working on an Rmarkdown editor with instant preview (similar to Mou/MacDown, MarkdownPad or Remarkable).

It's called editR and built with R and Shiny. It works well from within RStudio or inside a web browser when launched from the terminal. It's pretty basic (for now) but it works. You can find/clone/fork it on GitHub at: https://github.com/swarm-la....

Bug reports, comments and suggestions are welcome :-)

jjallaire • 9 years ago

Thanks, that looks fantastic!

Simon Garnier • 9 years ago

Thanks! I've been working on it on and off for a little more than a week. It's a bit rough for now but it's bound to improve :-)

Derma Waruwu • 10 years ago

thank you so much :)

Tanya AT • 7 years ago

HELP! I am trying to use rmd to create a beamer presentation, but I cannot figure out how to get <> printed in tex file, for example for beamer option \only<1>{} . rmarkdown keeps replacing <> signs with \textless and \textgreater . Using \only\<1\> did not help.

Tina • 7 years ago

I want to use R markdown, but it requires knitr 1.11, mine is knit 1.9. My R studio version is 0.99.902. I can reinstall evaluate package through install.packages('evaluate', type = "source"), but it does not work for knitr. Can anyone help me with this?

Tina • 7 years ago

Never mind, after I updated R to 3.3.1 version, it works well.

David Bruce Borenstein • 7 years ago

How do I prevent R Markdown from automatically embedding my graphic into the HTML? What I want it to include "[blah](blah.png)" and have the src of the resulting img tag be a URL.

jjallaire • 7 years ago

Just add self_contained: false to the document's output options.

Nguyen Trong Tung • 7 years ago

Look like Jupyter notebooks for Python.
It's exceptional for education!

friendly • 7 years ago

I'm using the latest R Studio, R 3.2.5, rmarkdown 0.9.6 to write a journal article. Submission requires: linespacing: 1.43 and a keywords: line just below the abstract.

When I click Knit PDF I get the template ` "C:\R\R-3.2.5\library\rmarkdown\rmd\latex\default-1.15.2.tex"` which does not support these fields in the YAML header. I see that default-1.17.02.tex supports linespacing, but not keywords:.

I guess I have to modify the latter template to add keywords handling. Is there an easier way? Is the template tied to a specific version of pandoc?

p0bs • 8 years ago

Guys - I can't decide what is more useful: Rmarkdown or dplyr. Yes, Rmarkdown is THAT good.

I have one question/aspiration: When I use Rmarkdown (ie daily), I often find that I'm writing a sentence about my results that could really benefit from a link to the code. For example, I'll say something like: "Doing so leaves us with 350 observations." However, if I change my code, I'd still like to say something similar but reflect that the number of observations may have changed a little.

At the moment, I either edit my text (which I try to avoid, as it is prone to error, because I might forget to edit all such instances) or write tangentially about the dataset (eg "as you'll see from the dimensions below, we still have a fair amount of data.") This latter option is safer but too wordy. What would be ideal (and may already be available) would be to have 'embedded' access to the value of a single variable.

If that were the case, I'd start by assigning the variable in the code: dataRows <- nrow(Data)
(Let's assume that the value of dataRows is 349.)
In the Rmd file, and with apologies for the example syntax, I'd then write something like: "Doing so leaves us with $$dataRows$$ observations."
After the Knit, that would produce: "Doing so leaves us with 349 observations."

Is that approach something that can be done in Rmarkdown?

Many thanks again for simplifying my life!

-- Robin

yihui • 7 years ago

Instead of $$dataRows$$, write `r dataRows`

p0bs • 7 years ago

That is superb. So many thanks ...

J. Colomb, PhD • 8 years ago

hey guys, it would be very useful if you could compile a documentation about dealing with markdown in loops. It is quite a nightmare using the print() function. I can get it to write an horizontal line between tables I produce in a loop. I am sure someone in Rstudio could think of something up.

Thanks for all the cool tools!

Zhu Harry • 8 years ago

Doc As an App, Rmd echoes a new age of the documentation! Thanks so much!

Daniel E. Weeks • 8 years ago

I would appreciate help solving this problem: When typesetting an R Markdown document to PDF, if a function draws multiple plots, those plots often appear side-by-side, with only the first plot fully within the margins of the page. R Markdown is not plotting all of the plots within the margins of the resulting PDF. The desired output is to end up with all of the plots within the margins of the document, at 'normal' width and height. Note that this problem has also occurred when using other's plotting functions (where one does not have an easy way to modify the plotting function). I have posted a detailed minimal example illustrating the problem at http://stackoverflow.com/qu...

Daniel Emaasit • 8 years ago

When will the new RMarkdown Notebook with inline input be released to the general public? I think I saw a demo by JJ Allaire at NYR conference. @jjallaire

jjallaire • 8 years ago

We will do a preview release at useR that includes the notebook.

John Abernethy • 8 years ago

I have been using R studio and authoring R markdown documents for quite a while now. I just got a new computer, installed R and the latest R studio, and when I go to the drop down menu to author an R markdown document, I get the following message:

Creating R Markdown documents requires an updated version of the markdown package

So I click "yes" to install the package, it downloads from "CRAN" and
something runs. It scrolls so fast in the shell window I can't capture
what happens. But when I close and reopen R studio it still asks to
update the version of the markdown package. Has anyone seen this before
and do you know what to do?

Thanks!

Oscar • 7 years ago

Hi John,

I've had an similar issue not with rmd but with other packages. In a GNU/Linux system, open a terminal and do the update as sudo. If you need a step-by-step guide let me know.

SeongBin Han • 8 years ago

Hi,
I've figured out how to fix it.
Just type
install.packages("rmarkdown"); install.packages("knitr")
in console and press enter.
After you do this, you won't see the messages that bothered you.

The two packages can't be installed at the same time. and I don't know why.
Maybe R studio crashed and maybe that's why.
Manually doing this will solve your problem.

Marcin KosiƄski • 8 years ago

Test message

Monika • 8 years ago

I am trying to import an image of 'png' format in R Markdown. I have to export it to Word document & pdf. My report consists of all such types of graphs. I have to import multiple graphs and make a report using Rmd. Does anybody know how can I do this? I tried a couple of things but none of them works. Here, is an exmaple of the code that I am trying

---

title: "Appendix D -Scatterplots of phytoplankton bioindicators"

author:

date:

output:

word_document: default

keep_tex: yes

fig_caption: yes

---

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http: rmarkdown.rstudio.com="">.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r, echo=FALSE}

paste("Hello", "world")

```

![pic1.](H:/plot1.png)

Thanks

SI • 8 years ago

I get the following error when I try to Knit to PDF. I've installed the complete version of Miktex and installed pandoc. Can anyone help?

_____________________________________________________________________________________________________
output file: test.knit.md

pandoc.exe: pdflatex not found. pdflatex is needed for pdf output.

Error: pandoc document conversion failed with error 41

In addition: Warning message:

running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output test.pdf --template "C:\PROGRA~1\R\R-32~1.3\library\RMARKD~1\rmd\latex\DEFAUL~2.TEX" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 41

Execution halted

No TeX installation detected (TeX is required to create PDF output). You should install a recommended TeX distribution for your platform:

Windows: MiKTeX (Complete) - http://miktex.org/2.9/setup

(NOTE: Be sure to download the Complete rather than Basic installation)

Prithviraj Lakkakula • 8 years ago

Can we create a title page in R markdown with author names just below the title and their affiliations at the bottom of the page as a footnote?

Matt Abbott • 8 years ago

Is there a way to output the runtime for code chunks?

joel allen • 8 years ago

When rendering a pdf I use the pandoc-crossref filter to cross reference figures and tables as well as pandoc-citeproc for citations. These two use a similar syntax for denoting the references requiring pandoc-crossref to be run first to pick off the fig and table refreences. The default rendering method scans the yaml for 'bibliography' and adds the --filter pandoc-citeproc to the command string in a fixed location before the filter pandoc-crossref listed in the pandoc_args breaking pandoc-crossref. The fix is to use rmarkdown::pandoc_convert directly as in:

rmarkdown::pandoc_convert("doc.Rmd", to="latex",output='doc.pdf',citeproc=FALSE,options=c('--filter','pandoc-crossref','--filter','pandoc-citeproc.exe'),verbose=TRUE)

This works if there is no R code needing to be run. How does one render to markdown processing any R code so that pandoc_convert can then be run to convert to pdf?

knitr::knit('doc.Rmd','doc.md')

seems to do the trick

John Travis • 7 years ago

Did you ever figure out how to use pandoc_args in the YAML to specify filters? I can get your pagebreak filter to work from the command line as well as using the procedure you have outlined above, but have not been successful specifying it in the YAML.

Raviteja Valluri • 8 years ago

I am getting the below error when i am trying to click the option "knit pdf".PLEASE HELP
Error in contrib.url(repos, "source") :
trying to use CRAN without setting a mirror
Calls: <anonymous> ... withVisible -> eval -> eval -> install.packages -> contrib.url
Execution halted

Ian Pylvainen • 8 years ago

It looks like your system is trying to install some required packages. You should make sure you've got a CRAN mirror set on your system and then try again. It may also help to install the required packages manually - `install.packages("rmarkdown")`