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

Search and extract timelines

Similar to search_tweets(), get_timeline() is another function in the rtweet library that can be used to extract tweets.

The get_timeline() function is different from search_tweets(). It extracts tweets posted by a given user to their timeline instead of searching based on a query.

The get_timeline() function can extract up to 3200 tweets at a time.

In this exercise, you will extract tweets posted by Cristiano Ronaldo, a very popular soccer player both on the field and on social media who has the @Cristiano twitter handle.

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

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

Analyzing Social Media Data in R

ดูคอร์ส

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

  • Extract 3200 tweets posted by Cristiano Ronaldo.
  • View the first few rows and columns of the extracted tweets.

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

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

# Extract tweets posted by the user @Cristiano
get_cris <- ___("___", n = ___)

# View output for the first 5 columns and 10 rows
head(___[,1:5], 10)
แก้ไขและรันโค้ด