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

标签 r pdf latex r-markdown pdflatex

我想在 R markdown 中编写类似I used lm() function in R 的东西,我希望 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.

输出:

enter image description here

关于R Markdown : how make I make inline code do not execute?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66179665/

相关文章:

html - 在 headless print-to-pdf 中禁用 Chrome 的默认页眉和页脚

java - 将 PDF 转换为具有页面范围的图像

image - 如何在 PDF 中插入透明的 PNG?

python - 如何从 pandas.to_latex 的输出中删除多余的反斜杠?

r - 观星者汇总表中的可变组标题

r - 用 R 在字符之间插入逗号

r - 如何使用多项 logit 模型的标准误差获得平均边际效应 (AME)?

R传播错误: Duplicate identifiers for rows

r - 如何从自定义存储库强制安装 R 包?

latex - 强制 pdflatex 为每个单词创建一个框