3

I have a list that looks like

[1] "SR7" "SW 38" "NW 35" "NW 34"

[5] "NW 31" "NW 27 " "SW 24 " "SW 22"

[9] "I-95 SB" "I-95 NB"

I want to print them as bulleted items in word, using R-markdown. It looks like below

  1. SR7
  2. SW 38
  3. NW 35
  4. NW 34
  5. NW 31
  6. NW 27
  7. SW 24
  8. SW 22
  9. I-95 SB
  10. I-95 NB

Can anyone show how to do that ?

macropod
  • 12,757
  • 2
  • 9
  • 21
naveen chandra
  • 149
  • 1
  • 7

1 Answers1

6

Add * before each list item:

---
title: "Bullet List Example"
author: "M.Viking"
date: "2/8/2021"
output: word_document
---

```{r bulletlist, results='asis'}
mylist <- c("a", "b", "c")
cat(paste("*", mylist), sep = "\n")
```
• a
• b
• c

Above is an unnumbered list. To generate an ordered numbered list, replace * with 1..

```{r numberedlist, results='asis'}
mylist <- c("a", "b", "c")
cat(paste("1.", mylist), sep = "\n")
```
 1. a
 2. b
 3. c
M.Viking
  • 5,067
  • 4
  • 17
  • 33