User interest and tweet counts
The metadata components of extracted twitter data can be analyzed to derive insights.
To identify twitter users who are interested in a topic, you can look at users who tweet often on that topic. The insights derived can be used to promote targeted products to interested users.
In this exercise, you will identify users who have tweeted often on the topic "Artificial Intelligence"
.
Tweet data on "Artificial Intelligence"
, extracted using search_tweets()
, has been pre-loaded as tweets_ai
.
The library rtweet
has been pre-loaded for this exercise.
This exercise is part of the course
Analyzing Social Media Data in R
Exercise instructions
- Create a table of users and tweet counts.
- Sort table in descending order based on tweet counts.
- View the top 10 users who have tweeted the most.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create a table of users and tweet counts for the topic
sc_name <- table(tweets_ai$___)
# Sort the table in descending order of tweet counts
sc_name_sort <- sort(sc_name, decreasing = ___)
# View sorted table for top 10 users
head(___, 10)