This vignettes provides a short time series analysis using the R package
rtweet: Collecting Twitter Data.
Accessing Twitter's API
Before you can start collecting data, you must first obtain a user access token. To do this, I recommend following the vignette on obtaining and setting up user access tokens. However, if you're in a hurry, the quick guide found here works as well.
Install and Load
install.packages("devtools") devtools::install_github("mkearney/rtweet") library(rtweet)
d <- stream_tweets(q = "debates2016", timeout = (60 * 10))
Plot time series
# plot time series ts_plot(d, by = "15 secs")