R Markdown:如何使内联代码不执行?

R Markdown: how make I make inline code do not execute?

我想写类似 我在 R 中使用 lm() 函数在 R markdown 中,我希望制作 lm( ) 脱颖而出,因为它是一个代码。

我尝试使用 我使用 `r lm()` 函数 方法使 lm() 脱颖而出,但它赢了'工作,因为程序不断告诉我 lm() 需要一个参数。

有没有办法强制内联代码只显示而不执行?谢谢!

只需删除 r 调用即可。

示例(.Rmd 文件):

---
title: "Untitled"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

I used the `lm()` function.

输出: