Created
August 5, 2016 22:17
-
-
Save zunman/a96852bfc763cc85633526d7efa42226 to your computer and use it in GitHub Desktop.
This file contains 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
#Remove RTs and urls | |
CaseSensitive_FilterTerms <- c("RT", "http") | |
filter_regex<- paste(CaseSensitive_FilterTerms, collapse = "|") | |
df <- filter(df, !grepl(filter_regex, df$text)) | |
#remove mentions. (only remove tweets that start with @) | |
df$noMentions <- 0 #add new temporary column | |
df$noMentions <- substr(c(df$text),0,1) | |
df <- filter(df, !grepl(c("@"), df$noMentions)) | |
df$noMentions <- NULL #remove temporary column added in line7 | |
write.csv(df, file = "files/tweets_noRtUrl_noMentions.csv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment