You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extraneous positioning dataframe emitted when combining grobs in Rmarkdown notebooks #231
As always, thank you so much for the wonderful packages!
Under patchwork 1.1.1 (sessioninfo here: sessioninfo.txt), all the grob combination operations I can think of (+, /, wrap_plots(), etc). print the positioning frame when run in the context of a RMarkdown notebook. This dataframe is not output when run from the console.
The constructed patchwork object otherwise works as expected, so this is a display issue when generating notebooks rather than a critical functionality issue.
Issue has been replicated via the R4DS Slack community as well.
changed the title [-]Extraneous posiitoning dataframe emitted when combining grobs in Rmarkdown notebooks[/-][+]Extraneous positioning dataframe emitted when combining grobs in Rmarkdown notebooks[/+]on Jan 8, 2021
@thomasp85 Any chance you could give a pointer on where to look to debug this issue? I'm happy to give a stab and identifying the root problem but am having a bit of uphill climb on understanding the flow of what's involved in this issue. Any debug guide you could give would be super appreciated. I'd love to get this issue fixed!
Very much appreciated! If there is any support we can give from a user side, please don't hesitate to ask. This particular issue is a personal bit of grit in my eye that I'd like to remove. 😄
I've taken a look, and it looks like a bug in RStudio. To explain the behavior:
When executing a Notebook chunk, RStudio inserts its own print() overrides, so that it can detect and capture attempts to print R objects. This is what allows RStudio to capture e.g. data.frame print-outs in a clean way.
RStudio also tries to detect changes to objects in the Environment pane as code chunks are executed. When new objects are created, or changed, we try to introspect those new objects to learn a bit more about those objects.
To that end, when inspecting the foo object, we call str(foo) -- but this involves calling print() when examining some of the internal data in foo.
Unfortunately, because the print() overrides in (1) are still active, we end up inadvertently capturing that output into the Notebook chunk.
I think we can fix this on the RStudio side by making sure we deactivate our print overrides when updating the Environment pane.
Activity
[-]Extraneous posiitoning dataframe emitted when combining grobs in Rmarkdown notebooks[/-][+]Extraneous positioning dataframe emitted when combining grobs in Rmarkdown notebooks[/+]vadimus202 commentedon Jan 19, 2021
I noticed the same issue after upgrading some tidyverse packages. The data frame only prints during assignment of combined plots to a variable.
rspreafico commentedon Feb 1, 2021
Same here
davidski commentedon Jun 6, 2021
@thomasp85 Any chance you could give a pointer on where to look to debug this issue? I'm happy to give a stab and identifying the root problem but am having a bit of uphill climb on understanding the flow of what's involved in this issue. Any debug guide you could give would be super appreciated. I'd love to get this issue fixed!
thomasp85 commentedon Aug 2, 2021
Hum... this looks super weird and I have no idea on top of my head for where the issue is
I'm sure I can fix this when I get around to it, but I'm afraid I wouldn't know how to guide others in the meantime
davidski commentedon Aug 2, 2021
Very much appreciated! If there is any support we can give from a user side, please don't hesitate to ask. This particular issue is a personal bit of grit in my eye that I'd like to remove. 😄
kevinushey commentedon Aug 8, 2023
I've taken a look, and it looks like a bug in RStudio. To explain the behavior:
print()overrides, so that it can detect and capture attempts to print R objects. This is what allows RStudio to capture e.g.data.frameprint-outs in a clean way.fooobject, we callstr(foo)-- but this involves callingprint()when examining some of the internal data infoo.print()overrides in (1) are still active, we end up inadvertently capturing that output into the Notebook chunk.I think we can fix this on the RStudio side by making sure we deactivate our print overrides when updating the Environment pane.
thomasp85 commentedon Aug 11, 2023
Thanks @kevinushey — I'm going to close it here as there is nothing more to do on the patchwork side of things