Somehow my RMarkdown document is not crossreferencing tables or figures. Here is a stripped down version of my document.
---
title: "Test"
author: "Me"
date: "01/04/2022"
output: bookdown::pdf_document2
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
var1<-sample(LETTERS)
tab1<-table(var1)
My table is in Table \@ref{tab:tab1}
library(knitr)
kable(tab1, caption="my table")
AS we see in Figure \@ref{fig:plot1}
plot(seq(1,10,1))