I am having some troubles with leading and trailing white space in a data.frame.
For example, I like to take a look at a specific row in a data.fra
row
data.fra
A simple function to remove leading and trailing whitespace:
trim <- function( x ) { gsub("(^[[:space:]]+|[[:space:]]+$)", "", x) }
Usage:
> text = " foo bar baz 3 " > trim(text) [1] "foo bar baz 3"