powered by
This function allows trimming/removing redundant text-fragments (redundant from head or tail) out of chracter vector 'txt'.
trimRedundText( txt, minNchar = 1, side = "both", spaceElim = FALSE, silent = TRUE, callFrom = NULL, debug = FALSE )
character vector to be treated
(integer) minumin number of characters that must remain
(character) may be be either 'both', 'left' or 'right'
(logical) optional removal of any heading or tailing white space
(logical) suppress messages
(character) allow easier tracking of messages produced
(logical) display additional messages for debugging
This function returns a modified character vector
# NOT RUN { x <- c("abcd","abcde","abcdefg","abcdE",NA,"abcdEF") trimRedundText(x) # }
Run the code above in your browser using DataLab