I am trying to remove special characters from one column (tweets) in a big database. The code is as follows:
alltweets$clean_text <- str_replace_all(alltweets$text, "@\\w+", "")
Where alltweets is the name of my dataset. The error I get is the following:
Error in
$<-.data.frame
(*tmp*
, "clean_text", value = character(0)) : replacement has 0 rows, data has 17410
I have tried to write tweets (the name of the column) instead of alltweets and the error shown is:
Error in stri_extract_all_regex(string, pattern, simplify = simplify, : object 'tweets' not found
I am trying to replicate this tutorial, but I have found it has small errors in the code. I have made the first part, but I am stocked with the cleaning text parts. The data is available for download online. I tried with several combinations of the signs to erase and the variable "nohandles" is created but it is empty. rpubs.com/cosmopolitanvan/r_isis_tweets_analytics
Nevermind, I solved it. Turns out the column name was wrong. Now I have some issues with the plot for positive and negative sentiments, but I guess I will have to create another question for that.