我正在尝试绘制时间线,其中包含来自用户ID的推文,后跟“ Spotify”,我的代码如下,但是我收到一条错误消息:
## get user IDs of accounts followed by Spotify
tmls <- get_timelines(c("Spotify","Pandora", n = 3200))
## plot the frequency of tweets for each user over time
tmls %>%
dplyr::filter(created_at > "2018-8-3") %>%
dplyr::group_by(screen_name) %>%
ts_plot("days", trim = 1L) +
ggplot2::geom_point() +
ggplot2::theme_minimal() +
ggplot2::theme(
legend.title = ggplot2::element_blank(),
legend.position = "bottom",
plot.title = ggplot2::element_text(face = "bold")) +
ggplot2::labs(
x = NULL, y = NULL,
title = "Frequency of Twitter statuses posted by streaming music companies",
subtitle = "Twitter status (tweet) counts aggregated by day from July/August 2018",
caption = "\nSource: Data collected from Twitter's REST API via rtweet"
)
错误信息如下:
Error in .subset2(x, i) :
attempt to select less than one element in get1index
我真的不知道该怎么解决此问题了。 非常感谢您的帮助!