Display leading/trailing whitespaces in RStudio data viewer?

One feature that I love about the tibble package is that "hidden" white spaces are made obvious with quotations.

aa <- tibble::tibble(abc= c("one", "two ", " three"))
aa
#> # A tibble: 3 x 1
#>   abc
#>   <chr>   
#> 1 one     
#> 2 "two "  
#> 3 " three"

For larger datasets, however, I like to use the RStudio data viewer (View(aa)) to take a quick look at the data for problems. However, leading and trailing whitespaces disappear, making it difficult to diagnose the problem. Is there a way to somehow "un-hide" the white spaces in View? (at the very least, for leading white spaces)

image

1 Like

Hey Irene,

This might make for a good feature request over in the IDE repo, if there isn't one already!

Mara

3 Likes

We fixed the leading space issue in RStudio 1.2. You can try a preview build if you'd like:

image

3 Likes

Neat! That's great to know.

@jonathan are there already plans for dealing with trailing spaces? I'm imagining something to show/hide formatting marks like in MS Word...

image

2 Likes

No, that isn't currently on the radar (but feel free to file a feature request!)

1 Like

Feature request submitted: https://github.com/rstudio/rstudio/issues/3428 :partying_face:

1 Like