เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Filtering on tweet language

You can use the language filter with a search query to filter tweets based on the language of the tweet.

The filter extracts tweets that have been classified by Twitter as being of a particular language.

Can you extract tweets posted in French on the topic "Apple iphone"?

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

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Analyzing Social Media Data in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Extract posts on "Apple iphone" that are tweeted in French.
  • Display the tweet text.
  • Display the tweet metadata showing the language of the tweet.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Extract tweets on "Apple iphone" in French
tweets_french <- search_tweets("Apple iphone", ___ = "fr")

# Display the tweets
head(tweets_french$___)

# Display the tweet metadata showing the language
head(tweets_french$___)
แก้ไขและรันโค้ด