Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The output of glimpse() is too wide in RStudio Visual Editor mode #656

Open
GegznaV opened this issue Feb 3, 2024 · 6 comments
Open

The output of glimpse() is too wide in RStudio Visual Editor mode #656

GegznaV opened this issue Feb 3, 2024 · 6 comments

Comments

@GegznaV
Copy link

GegznaV commented Feb 3, 2024

In RStudio Visual Markdown mode, the output of glimpse() is distorted (the summary of one column does not fit into a single line)

Steps to reproduce the issue:

  1. select a data frame with a big enough number of rows;
  2. apply glimpse() on the data frame.

Current output of pillar::glimpse(iris):
image

Expected output (the output in console):
image

If the editor's pane is made even wider, the issue gets even worse:
image

@krlmlr
Copy link
Member

krlmlr commented Feb 3, 2024

Thanks. The width is controlled by getOption("width") , IIRC. Can you check the value of this option in the visual markdown editor? Can you work around by setting the option to a smaller value?

@GegznaV
Copy link
Author

GegznaV commented Feb 3, 2024

Yes, sure. In the following circumstances, the width is 133:

image

So I'm not sure if this is an issue with Visual Editor, which provides the wrong value of output width, or of glimpse(), which does not correct it appropriately. What do you think?

@krlmlr
Copy link
Member

krlmlr commented Feb 3, 2024

It seems that the glimpse() output is at most 132 characters per line?

In the IDE, the "width" option is changed when you resize the console tab. Does this have an effect on the visual editor?

@GegznaV
Copy link
Author

GegznaV commented Feb 3, 2024

Yes, the value changes. But it seems that getOption("width") shows the total width of the editor (or console) window and not the width of the Visual Editor output area. The same width is printed when I run code in the Visual editor and the console (I expect different):

image

@GegznaV
Copy link
Author

GegznaV commented Feb 3, 2024

One more test. I measured the number of characters that fit into a single line of output:

image

@krlmlr
Copy link
Member

krlmlr commented Feb 3, 2024

Can you please take this to https://github.com/rstudio/rstudio then? This will also affect other packages that use the "width" option. This might be a known issue, haven't looked.

@GegznaV GegznaV changed the title The outout of glimpse() is too wide for RStudio in Visual Markdown mode The output of glimpse() is too wide in RStudio Visual Editor mode Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants