Repository navigation
Description
System details
RStudio Edition : Desktop
RStudio Version : 2022.07.0 Build 548
OS Version : Win 10
R Version :
Steps to reproduce the problem
Consider the following Rmarkdown:
---
title: "Non R Chunks Prevent Run All"
output: html_document
editor_options:
chunk_output_type: console
---
```{css css-chunk, echo = FALSE}
.sql {
background-color: #cdd9ef;
}
```
```{r myconsts}
a <- 1
```
```{sql sql-chunk, connection = DBI::dbConnect(RSQLite::SQLite())}
SELECT 1
```
```{r r-chunk}
a + 1
```
Now press the Run all Chunks above button in the last r chunk:
Describe the problem in detail
The first non R chunk (i.e. the CSS chunk) will (naturally) fail with an error in the console, stopping all the other chunks to run. If I remove the CSS chunk, Run all... will trip over the SQL chunk.
Describe the behavior you expected
I think it is a natural workflow to run the R code in the console once in a while to some quick checks without the need to re-render the whole document. Any non R chunk prevents me from using the Run all Chunks above button, which is annoying as I have now to run all R chunks manually. I would expect that any non R chunk is excluded from Run all Chunks above by default, or at least a chunk option with which I could manually exclude certain chunks from being considered in the Run all. Another viable solution would be to be able to tell Rstudio to continue on error nevertheless.
N.B. An eval = FALSE chunk option allows me to use the Run all... button, but then, well, the chunk is not evaluated when rendering. Clearly not what I want.
Interestingly enough, if I decide to output inline,, I can at least run the chunks.
- 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
ronblum commentedon Sep 21, 2022
cderv commentedon Sep 22, 2022
@ronblum I believe the issue really is that the

csschunk should not be run. It does not even have a run buttonSo probably
Run all Chunk aboveshould skip it. 🤔jgutman commentedon Nov 17, 2022
It appears the CSS chunk does not run with Run All or Run All Chunks Above, so I believe that part of the issue has been resolved. The SQL issue still stands, and interferes with subsequent chunk execution, but the SQL issue is a duplicate of #6769
This is in version 2022.12.0-preview+330. Closing this issue in preference to #6769, but please comment again if you believe the CSS issue persists -- on my end the CSS does not get executed/evaluated in console mode.
DesiQuintans commentedon Dec 7, 2022
I still get this issue with CSS chunks in RStudio 2022.07.2 Build 576 (newest available) on Windows 11 64-bit.
I can reproduce it by creating a new RMarkdown doc with the default template (New File > RMarkdown > Okay), inserting this CSS chunk above the setup chunk:
Enabling "Chunk Output In Console", and then using Run All Chunks Above from the
carsR chunk.Knitting the Rmd to a HTML page works fine. It's just Run All Chunks Above that does not.
cderv commentedon Dec 7, 2022
@DesiQuintans it is probably best to open a new issue and link to a close one so that it is triaged correctly.
@ronblum should we create a new issue from this or is it ok to reopen here if the issue is confirmed by you ?
12 remaining items
ronblum commentedon Feb 26, 2024
Another example, from @GegznaV in issue #14324:
ronblum commentedon Feb 29, 2024
Possible solution: in console mode, only execute R chunks
victorfeagins commentedon Apr 19, 2024
Any updates on this? For me this is only an issue when output goes to the console instead of inline.
kevinushey commentedon Apr 20, 2024
We're planning to investigate this for the next release.
gadenbuie commentedon May 17, 2024
Another example, using a custom knitr engine as reported in gadenbuie/epoxy#126
The above document knits correctly, but clicking Run All returns Error:
unexpected symbol in "The average"ronblum commentedon Sep 16, 2024
Verified in RStudio Desktop 2024.09.0+372 on Windows 11 using multiple examples from above.