1

I have a R notebook named "test.Rmd" with the following content:

---
title: "R Notebook"
output: html_notebook
---
```{sh}
faToTwoBit dmel-all-chromosome-r6.04.fasta dmel-all-chromosome-r6.04.2bit
```

Then rstudio will create "test.nb.html" automatically. However, the code chunks are wrongly displayed in the html:

enter image description here

It only displayed bit, instead of the entire line (faToTwoBit dmel-all-chromosome-r6.04.fasta dmel-all-chromosome-r6.04.2bit). Is there something wrong with my .Rmd?

1
  • Using output: html_document in your YAML header should work. Commented Oct 29, 2017 at 18:33

1 Answer 1

2

I'm not familiar with the shell command you are running, however, it seems that the language engine is getting confused with the way to display it.

Given that the form is meant to be faToTwoBit in.fa [in2.fa in3.fa ...] out.2bit, I recommend explicitly stating the engine.

---
title: "R Notebook"
output: html_notebook
---

```{test1, engine="sh"}
faToTwoBit dmel-all-chromosome-r6.04.fasta dmel-all-chromosome-r6.04.2bit
```

enter image description here

You could also lodge an issue on github, where they may be able to provide a more permanent solution.

Sign up to request clarification or add additional context in comments.

4 Comments

Hi, Kevin. Thanks for the answer. In fact I just want to display the shell commands as a code chunk in final report instead of running the commands. I also filed an issue on github following your suggestion.
@mt1022, you can add eval=FALSE to your code chunk to display the code but not evaluate it
sure. I have set the options as {test1, engine="sh", eval=FALSE}.
@mt1022, does that provide you the result you are after?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.