Babak Fi Foo
Babak Fi Foo

Reputation: 1048

Cross-referencing in R bookdown makes the figure name incorrect

I am producing plotly charts in Rmarkdown and give them name and caption. but as soon as I cross reference them in the document, their name is ruined.

Here is the code:

---
title: "Preliminary Statistics"
author: "Babak"
date: "6/28/2021"
output: 
  bookdown::html_document2:
    fig_caption: true
    
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
    echo = FALSE,
    fig.width=9, 
    fig.height=5 ,
    message=FALSE, 
    warning=FALSE)
```

```{r Area_duplicate, fig.cap = "Area of duplicated and unique properties by municipality"}
<PLOT CODES>
```
Plot \@ref(fig:Area_duplicate) shows the area od duplicated properties in the dataset grouped by municipality.

result:

screenshot of the caption

What should I do to resolve this issue?

Upvotes: 1

Views: 145

Answers (1)

Ben Welman
Ben Welman

Reputation: 301

Replace the underscore in the name with a "-".

Upvotes: 2

Related Questions