Skip to content

Rmd chunk option eval does not take variable when run "Restart R and Run All Chunks" #14408

Open

Description

@brb-arraytools

System details

RStudio Edition : <!-- Desktop or Server -->Desktop
RStudio Version : 2023.12.1 Build 402
OS Version      : Windows 11
R Version       : 4.3.2

Steps to reproduce the problem

```{r chunk1}
do_it = FALSE
```

```{r chunk2, eval=do_it}
x = rnorm(100)
```

Describe the problem in detail

When opening the above codes in RStudio and selecting Run "Restart R and Run All Chunks", eval will not take the variable do_it value.

Describe the behavior you expected

It should take the value of do_it and should not run the second chunk2.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Mar 12, 2024
  2. ronblum commented on Mar 12, 2024

    @ronblum
    Contributor

    @brb-arraytools Thank you for raising this! I can reproduce this, going at least back to RStudio Desktop 2022.07.2+576 on MacOS 14.4. Setting eval=FALSE works as expected (no evaluation).

    I added x to the example just to make sure.

    ```{r chunk2, eval=do_it}
    x = rnorm(100)
    x
    ```
    

    which adds the output

      [1]  0.98471513 -0.05833429  0.58972107 -0.71571049
      [5] -0.20165055  0.06433444 -1.90373053  0.43177449
    

    etc.

  3. added and removed
    new
    on Mar 12, 2024
  4. added this to the Product Backlog milestone on Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions