Last active
August 29, 2015 14:17
-
-
Save alfcrisci/e7b229ab0ff93a9a788e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # from a char vector | |
| extracts_tweet=function(text) { | |
| require(stringr) | |
| res=list() | |
| res$hashtags_text=unique(unlist(str_extract_all(text,'(#[[:alnum:]_]*)'))) | |
| res$links_text=unique(unlist(str_extract_all(text,'http[^[:blank:]]+'))) | |
| res$mentions_text=unique(unlist(str_extract_all(text,'(@[[:alnum:]_]*)'))) | |
| return(res) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment