rm_url(text.var, trim = TRUE, clean = TRUE, pattern = "(http[^ ]*)|(www\\.[^ ]*)", replacement = "", extract = FALSE, ...)
TRUE
removes leading and trailing white
spaces.TRUE
extra white spaces and escaped
character will be removed.fixed = TRUE
) to be matched in the given
character vector.pattern
.TRUE
the URLs are extracted into a list
of vectors.gsub
.Returns a character string with URLs removed.
Remove/replace/extract URLs from a string.
## <strong>Not run</strong>: # x <- " I like www.talkstats.com and http://stackoverflow.com" # rm_url(x) # rm_url(x, replacement = '<a href="\\1" target="_blank">\\1</a>') # rm_url(x, extract=TRUE) # ## <strong>End(Not run)</strong>
gsub