API Homework
Intro
Hello Joel!
Hey Joel, hope you’re doing well! This is my attempt to do the API homework.
This is what I did:
I used the “search_tweets2” command so that I could search twitter for multiple keywords. for the lows data table I used the Words Lowes, LowesMedia, and the hastage #lowes. For the Home Depot Data Table I searched for HomeDepot, Home Depot and the hashtag #homedepot.
I searched for 400 data points, and I did not include retweets, I also filtered out anything from Lowes’ main account.
Question 1**
Which of the two stores has more popular tweeters?
I chose this question becuase it seems like many people are either Lowe’s shopers or Home Depot shoppers with no in between. I based this on how many tweets from each data set had more than 3 retweets.
Lowes_retweets <- filter(rtweet_lowes, retweet_count > 3)
Homedepot_retweets <- filter(rtweet_HomeDepot, retweet_count > 3)ggplot(Lowes_retweets, aes(x=screen_name, y=retweet_count)) +
geom_point(stat= "identity", color = "blue") +
ggtitle("Lowes tweets with over 3 retweets within the last 6 to 9 days") +
labs(x= "Twitter Handle", y= "Number of Retweets") ggplot(Homedepot_retweets, aes(x=screen_name, y=retweet_count)) +
geom_point(stat= "identity", color = "Orange") +
ggtitle("Home Depot tweets with over 3 retweets within the last 6 to 9 days") +
labs(x= "Twitter Handle", y= "Number of Retweets") +
theme(axis.text.x = element_text(angle = 45, hjust = 1))From this data, we can see that not a lot of tweets about Lowes or Home Depot go very viral. the most we see is one tweet from DannyHatters with 15 retweets.
Question 2
Who is tweeting longer tweets? I will be looking at the character length of each lowes and Home Depot tweeters. From this data we should be able to see how serious people are when they are tweeting about these topics by seeing how many characters they are typing.
I did this by only displaying tweets with over 250 characters.
Lowes_longbois <- filter(rtweet_lowes, display_text_width > 250)
Homedepot_longbois <- filter(rtweet_HomeDepot, display_text_width > 250) ggplot(Lowes_longbois, aes(x=screen_name, y=display_text_width)) +
geom_point(stat= "identity", color = "blue") +
ggtitle(" Tweets with over 250 characters") +
labs(x= "Twitter Handle", y= "Number of Characters") +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) ggplot(Homedepot_longbois, aes(x=screen_name, y=display_text_width)) +
geom_point(stat= "identity", color = "Orange", ) +
ggtitle("Tweets with over 250 characters") +
labs(x= "Twitter Handle", y= "Number of Characters") +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) When looking at the data we see that it looks pretty similar and over the 400 observations that both the depot and Lowes have just over 50 observations that are over 250 characters. The data is very very similar.
Question 3
Who is verified tweeting at lowes and Home Depot? I think this is interesting because it seems like twitter will give a blue checkmark to anyone. It would be interesting to see how many “celebrities” are interacting with the Lowes and Home Depot Account.
## [1] 58361
Homedepot_bluecheck <- filter(rtweet_HomeDepot, verified == "TRUE")
max(Homedepot_bluecheck$followers_count)## [1] 26359
ggplot(Lowes_bluecheck, aes(x=screen_name, y=followers_count)) +
geom_point(stat= "identity", color = "blue") +
ggtitle(" Verified Users who Tweeted mentioning Lowes, and How Many Followers They Have") +
labs(x= "Twitter Handle", y= "Number of Followers") +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) ggplot(Homedepot_bluecheck, aes(x=screen_name, y=followers_count)) +
geom_point(stat= "identity", color = "orange") +
ggtitle(" Verified Users who Tweeted mentioning Home Depot, and How Many Followers They Have") +
labs(x= "Twitter Handle", y= "Number of Followers") +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) From this data we see that of the 800 observations, only nine accounts that tweeted about Lowes and Home Depot are verified. And of this small group, the account with the most followers is COEmergency, with 58361 followers. very interesting!