Do not work knit document to HTML

Hello I make a r markdown file, it just have only markdown text.
And I click the ‘knit document’, R Markdown console says just ‘Execution halted’(Only This...!!!)
How can I fix this error?

My OS is mac osx catalina and I installed packages knitr , rmarkdown and markdown

P.S ) I tried this command but it make .md file but do not make .html file.

install.packages(‘knitr’)
install.packages(‘markdown’)
library(knitr)
library(markdown)
knit(‘filename.Rmd’)
markdownToHTML(‘filename.md’)

I just created a new Rmd file in RStudio with File | New File | R Markdown ... and indicated that I wanted to create an html file. I can knit that with the knit button.
You should also be able to do so. If that is the case then you made an error in the Rmd file and most probably in the YAML header: the first part of the file between the two ---lines. Can you show your YAML including the --- lines?

Regarding the PS part:
I experience the same when I handled the new Rmd file in this way: no html output. Looking at the documentation I saw that an output argument is expected. When I entered

markdownToHTML(‘filename.md’,output =‘filename.html’ )

the html file indeed was created.

I expect that with this correction your PS statements should have the same result as the knit button: so after correcting the Rmd file (still assuming there is something wrong there) both method should work.

Oh Thank you for your solution!

I can solve the problem by your solution about 'markdownToHTML'.

And I show my .Rmd file contents.

---
title: "Test1"
output: html_document
---
1. Header

# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5

2. Emphasizing text
  _This_ is __a__ *test* **code**.
  

I write this. Thank you very much!!! :slight_smile:

When I copied your contents to a new Rmd file I could knit it without any problems.
But I understand that your first method (using the knit button) still does not work (??)
Or did not you try it again?

I try it again, but still does not work.

R Markdown console say just 'execution halted'....

I use R and (a rather new version of) RStudio on Windows 10 so my screen


probably looks different than yours. When I use the button (indicated in red by me) I have no problems and an RStudio browser window is opened that shows the html file.

Sorry I can not help you any further, because using a button to do the whole process is very convenient.
On the other hand using the commands is more reproducible :wink:

Ok! I don't know why that button does not work in my computer :joy:

But You are very helpful to me by how to use command 'markdownToHTML' Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.