-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Milestone
Description
Hey Rich and co!
I created a data frame with intentional leading whitespace and it looks like converting to a gt object automatically removes this?
the_data <- data.frame(
spacey = c("No space", " Four Spaces", " Four Spaces")
)
# my spaces are gone :(
the_data(gt)
I attempted to get clever and replace the whitespaces with  
encode_whitespace <- function(strg) {
gsub(" ", ' ', strg)
}
the_data %>%
mutate(spacey = encode_whitespace(spacey)) %>%
gt()
But 🤦 this is interpreted as literal text womp womp. Hoping you have a better idea! 🤞
PS as a more general feature request: this might be too opinionated but just throwing it out there.... it would align with my mental model for the default behavior of gt() to keep any user created whitespace before generating the table. In my mind this puts the onus on the user to clean up rather than have gt do it for us? Just a thought!
Oh and thanks again for this package it's the GOAT table generator ❤️
Reactions are currently unavailable