Line numbers for code blocks

I'd like to have line numbers for code blocks in my R Markdown documents. When I follow Yihui Xie's cookbook, I think I should end up with this code:

title: "Untitled"
author: "Unauthored"
date: "0/20/2020"
    highlight: tango

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

## Line numbers

```{r, attr.source='.numberLines'}
if (TRUE) {
  x <- 1:10
  x + 1

But it gives me no line numbers:

Is it me?