Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve this error message in rmarkdown?

I am just starting to explore the rmarkdown package. I don't use Rstudio. I use the default R environment. What I did was as follows.

I created a new R document. Started typing few lines in rmarkdown format. Saved the file with Rmd extension. I saved the file in the working directory. I installed the pandoc using the pkg file. I installed 'rmarkdown' package. Loaded the package. Used the following command to render the Rmd file.

rmarkdown::render("Untitled.Rmd")

I get the following error.

Error in tools::file_path_as_absolute(input) : file 'Untitled.Rmd' does not exist

I tried all the possible ways such as giving the exact path instead of filename etc. But nothing worked out. I googled the error message and found that none had similar error. Can someone help me with this. What I am missing. What the error message mean?

like image 811
Veera Avatar asked Oct 28 '14 18:10

Veera


People also ask

Why is my R Markdown file not knitting?

No Knit HTML button This means that RStudio doesn't understand your document is supposed to be an RMarkdown document, often because your file extension is . txt . To fix this, go to the Files tab (lower right corner, same pane as Plots and Help) and select the checkbox next to your document's name.

How do I ignore an error in R?

The simplest way of handling conditions in R is to simply ignore them: Ignore errors with try() . Ignore warnings with suppressWarnings() .

What does ## do in R Markdown?

Text: Also on this page, one can see text sections, for example, one section starts with “## R Markdown” this section will render as text when the PDF of this file is produced and all of the formattings that the user will learn generally applies to this section.


1 Answers

Most of the time the error file not found is either a type error or a real missing file (as in your case, the real one is named in another way).

In order to discard those possibilities:

  1. Copy the fullpath from your filebrowser.
  2. Make sure the file exists, inside R you could type:

    file.exists("/fullpath/to/file")

If that return TRUE and the error persists, then you suspect another thing is going on.

like image 164
xihh Avatar answered Sep 23 '22 08:09

xihh