### Bug description

Hi! Why the following code does not return the output expected ? Is there a way to set the whole document to return the same print from R code?
``````md
---
title: "Accessing variable from code chunk"
format:
  pdf:
    toc: false
    number-sections: false
---

# Behavior 

```{r}
x <- 10011
```
Printing the result: `r x`

# Behavior expected

```{r}
y <- 10011
```

Printing the result: 10011
``````

![image](https://user-images.githubusercontent.com/63704591/183314146-d96b97fe-7835-450c-8f3f-4d25f45979db.png)


### `quarto check` Output

_No response_

### `quarto tools check` Output

_No response_

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-08-07T22:59:37Z
Gabrielforest
bug
closed
Accessing variable from code chunk
https://github.com/quarto-dev/quarto-cli/issues/1725