按推文语言过滤
您可以在搜索查询中使用语言过滤器,根据推文的语言来筛选推文。
该过滤器会提取被 Twitter 归类为特定语言的推文。
您能否提取关于 "Apple iphone" 的法语推文?
本练习已预先加载 rtweet 库。
本练习是课程的一部分
用 R 分析社交媒体数据
练习说明
- 提取关于
"Apple iphone"的法语推文。 - 显示推文文本。
- 显示包含推文语言的推文元数据。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# 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$___)