Analyzing Twitter data with R (part 3: Cleaning & organizing the Data)
After we have explained in the previous parts, how to set up the access to Twitter's API and how to import tweets with a simple R command, in this third part we will try to organize and clean the data we have imported in good reusable format. So let's pick up from where we left off , after finishing the authentication process, now we want to import certain tweets. the command searchTwitter from the package twitteR will do the job for us. we need to create a new object that will contain the data we are about to import and give it the result of our searchTwitter function. In our example, we will be querying Twitter for the tweets containing the hashtag #Tunisia , we will import 1000 English tweets. and we will have a preview of the imported data with the head() function: