Q: Function below does not remove URLs completely.
A: Use code below, where ":alnum:" matches any alphanumeric characters, incl. letters and numbers, and ":punct:" matches punctuation characters. See details by running "?regex" under R or googling for "regular expression".
If there are non-ASCII characters in URL, you can use function below, which removes string starting with "http" and followed by any number of non-space characters.