Generating labels and figure number in R markdown

Dear colleagues,
I am trying to generate figure number and captions in R markdown so that it can be cross referenced.
Here is my YAML header:

---
title: "Exploratory Analysis of Chicago Crime Data in the Period, 2001 through 2018"
#author: "Jayant Singh"
#date: "1/30/2019"
output: 
 html_document: 
    fig_caption: yes
---

And in the chunk with the figure, I have the following syntax,

```{r ,fig.cap= 'Concentration of Residence Crimes'}
   ggplot()+......

But in the HTML output, I am unable to see the figure caption as well as the label. I am expecting to see sth like Fig one: Concentration of Residence Crimes.
May I kindly get some feedback here?thanks

Another option is to use bookdown package, this package provides built-in numbering of figures across Word, HTML and PDF.

---
title: "Test"
output: bookdown::html_document2
---

```{r setup}
library(bookdown)
```

# Section

text 1

```{r, fig.cap= 'first'}
plot(cars)
```

text 2

# Section
```{r, fig.cap= 'second'}
plot(pressure)
```

text 3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.