MulaiMulai sekarang secara gratis

Filtering for original tweets

An original tweet is an original posting by a twitter user and is not a retweet, quote, or reply.

The "-filter" can be combined with a search query to exclude retweets, quotes, and replies during tweet extraction.

In this exercise, you will extract tweets on "Superbowl" that are original posts and not retweets, quotes, or replies.

The libraries rtweet and plyr have been pre-loaded for this exercise.

Latihan ini adalah bagian dari kursus

Analyzing Social Media Data in R

Lihat Kursus

Petunjuk latihan

  • Extract tweets that are not retweets, quotes, or replies.
  • Check for the presence of replies.
  • Check for the presence of quotes.
  • Check for the presence of retweets.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Extract 100 original tweets on "Superbowl"
tweets_org <- search_tweets("Superbowl ___:___ ___:___ ___:___", n = 100)

# Check for presence of replies
___(tweets_org$reply_to_screen_name)

# Check for presence of quotes
___(tweets_org$is_quote)

# Check for presence of retweets
___(tweets_org$is_retweet)
Edit dan Jalankan Kode