I\'m working on a data frame that has non-detects which are coded with \'<\'. Sometimes there is a space after the \'<\' and sometimes not e.g. \'<2\' or \'< 2\
late to the party. but if you only want to get rid of leading/trailing white space, R base has a function trimws
trimws
For example:
data <- apply(X = data, MARGIN = 2, FUN = trimws) %>% as.data.frame()