Repository navigation
Description
System details
RStudio Edition : Desktop
RStudio Version : 1.2.5019
OS Version : Windows 10 x64 (build 17134)
R Version : 3.6.2
Steps to reproduce the problem
Run this gist in your RStudio instance interactively to capture the R notebook chunk outputs inline. After running the 'cars' chunk, try to pop-out the chunk so zoom and the output will change.
I will work on making a more specific MRE, as this was what I could come up with at the moment. The printing behavior of color_vctr (which is the field that is changing) is dependent on whether it is being run 1) interactively 2) in a notebook chunk 3) what knitr is kniting the document to.
Describe the problem in detail
It looks like the option "rstudio.notebook.executing" gets set to FALSE when using R Notebook chunk output types is set to inline and clicking the "pop-out" field. When the code is run normally and the notebook captures the output, the option is set to TRUE, as expected. But when I click the 'pop-out' button my output changes.
I don't believe this behavior is expected.
Describe the behavior you expected
I would expect the inline chunk output and the pop-out to maintain the same output. The way that it prints, I believe it is because the option "rstudio.notebook.executing" is not being set to TRUE.
- I have read the guide to submitting good bug reports at https://github.com/rstudio/rstudio/wiki/Writing-Good-Bug-Reports .
- I have installed the latest version of RStudio and confirmed that the issue still persists.
- If I am reporting a RStudio crash, I have included a diagnostics report. https://support.rstudio.com/hc/en-us/articles/200321257-Running-a-Diagnostics-Report
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Activity
kevinushey commentedon Apr 29, 2020
For posterity, this is what I see -- HTML colors are used in inline output, and ANSI codes are used in the popped-out window.
And this is where
colortablemakes use ofrstudio.notebook.executing:https://github.com/thebioengineer/colortable/blob/e3353a415ee1deaa8f58d8ab54dac719642bb480/R/utils.R#L9
So it does indeed look like we're executing code for the popped-out chunk without that option set.
thebioengineer commentedon Apr 29, 2020
Sorry for not including screenshots. The ANSI code is for when I print a data.frame or tibble to console for the table elements to be colored. I only anticipate that to occur when both
interactive()andrstudio.notebook.exectutingisFALSE.Additionally, when I use kable to print (I have a custom kable print method for data.frames), it renders properly. So it has to do with somehow on the generation of the pop-out, the paged table is re-formatting the output and thus getting the new output.
thebioengineer commentedon May 6, 2020
I also noticed this happens when you generate the report as html_notebook as well: