Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Analyzing Social Media Data in R

Cursus bekijken

Oefeninstructies

  • 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.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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)
Code bewerken en uitvoeren