Skip to content

Notebook Popout Behavior Inconsistency #6767

Open

Description

@thebioengineer

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.

Activity

  1. kevinushey commented on Apr 29, 2020

    @kevinushey
    Collaborator

    For posterity, this is what I see -- HTML colors are used in inline output, and ANSI codes are used in the popped-out window.

    Screen Shot 2020-04-29 at 10 34 55 AM

    And this is where colortable makes use of rstudio.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.

  2. added this to the v1.4 milestone on Apr 29, 2020
  3. thebioengineer commented on Apr 29, 2020

    @thebioengineer
    Author

    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() and rstudio.notebook.exectuting is FALSE.

    image

    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.

    image

  4. thebioengineer commented on May 6, 2020

    @thebioengineer
    Author

    I also noticed this happens when you generate the report as html_notebook as well:

    image

  5. modified the milestones: v1.4, Later on Jul 16, 2020
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