ComeçarComece de graça

Filter based on tweet popularity

Popular tweets are tweets that are retweeted and favorited several times.

They are useful in identifying current trends. A brand can promote its merchandise and build brand loyalty by identifying popular tweets and retweeting them.

In this exercise, you will extract tweets on "Chelsea" that have been retweeted a minimum of 100 times and also favorited at least by 100 users.

The library rtweet has been pre-loaded for this exercise.

Este exercício faz parte do curso

Analyzing Social Media Data in R

Ver curso

Instruções do exercício

  • Extract tweets with a minimum of 100 retweets and 100 favorites using filters.
  • Create a data frame with the retweet and favorite counts.
  • View the tweets.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Extract tweets with a minimum of 100 retweets and 100 favorites
tweets_pop <- search_tweets("Chelsea ___:___ AND ___:___")

# Create a data frame to check retweet and favorite counts
counts <- tweets_pop[c("___", "favorite_count")]
head(counts)

# View the tweets
head(tweets_pop$text)
Editar e executar o código