3

I want to write something like I used lm() function in R in R markdown and I wish to make the lm() stand out as it is a code.

I tried to use I used `r lm()` function method to make lm() stands out, but it won't work as the program keeps telling me that lm() needs a parameter.

Is there a way I can force the inline code just display and do not execute? Thank you!

Michael
  • 439
  • 1
  • 4
  • 15

1 Answers1

4

Just remove the r call.

Example (.Rmd file):

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

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

## R Markdown

I used the `lm()` function.

Output:

enter image description here

bttomio
  • 2,206
  • 1
  • 6
  • 17