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
The best method is trimws().
The following code will apply this function to the entire dataframe.
mydataframe<- data.frame(lapply(mydataframe, trimws),stringsAsFactors = FALSE)