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"))
#> # 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)



Hey Irene,

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



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




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...



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


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