r-lib / pillar

Format columns with colour
https://pillar.r-lib.org/
Other
178 stars 37 forks source link

glimpse col number #327

Open ghost opened 3 years ago

ghost commented 3 years ago

Is there any way to make glimpse() show column numbers? This feature would be very useful, especially when working with large datasets which require operating with column range as opposed to single columns.

krlmlr commented 3 years ago

Interesting idea. Generally, I tend to always address columns by name, because addressing by column index can be very brittle: insert one column, and the indexes are off. I do acknowledge the use case, but I'd rather avoid encouraging addressing by column index.

Would you like to contribute a pull request that adds an optional argument to glimpse(), defaulting to NULL (=no column index)?

sjackson1997 commented 1 year ago

My knowledge of coding is poor at best, but I will look later to see if this is something I can do. I came here looking to see if this request had been made, and while I agree with the brittle-ness argument about using column indexes, when I'm working interactively sometimes with column 57 (or is it 58?), it would be nice to see the column numbers quickly using glimpse().

But it would be better if I can help myself by contributing code, so that's on me.