当我使用 twitteR 包中的 userTimeline() 函数时,为什么我无法获得我请求的推文数量?我现在对用户时间线的限制请求是 3200 条推文,但我只得到了其中的大约 10%...
这里有两个例子:
在此示例中,“googledevs”帐户只有 2,000 条推文,所以我确实请求了 1000 条推文,但我仍然只有 106 条...
> library(twitteR)
> load('OAuth.RData')
> test <- userTimeline(user = 'googledevs', n=1000)
> length(test)
[1] 106
在此示例中,“FiveThirtyEight”有 5622 条推文。于是我要了3200只拿到了317...
> library(twitteR)
> load('OAuth.RData')
> test2 <- userTimeline(user = 'FiveThirtyEight', n=3200)
> length(test2)
[1] 317
有人可以帮我解决这个问题吗? 谢谢
最佳答案
您需要在 userTimeline 调用中包含 includeRts=TRUE 参数。这应该为您提供用户时间轴上推文的最大数量和 3200。
关于R 和 twitteR - userTimeline() 函数不返回请求的推文数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29333116/