ts_plot | R Documentation |
Creates a ggplot2 plot of the frequency of tweets over a specified interval of time.
ts_plot(data, by = "days", trim = 0L, tz = "UTC", ...)
data |
Data frame or grouped data frame. |
by |
Desired interval of time expressed as numeral plus one of "secs", "mins", "hours", "days", "weeks", "months", or "years". If a numeric is provided, the value is assumed to be in seconds. |
trim |
The number of observations to drop off the beginning and end of the time series. |
tz |
Time zone to be used, defaults to "UTC" (Twitter default) |
... |
Other arguments passed to
|
If
ggplot2 is
installed then a ggplot2::ggplot()
plot object.
if (auth_has_default()) { ## search for tweets containing "rstats" rt <- search_tweets("rstats", n = 100) ## plot frequency in 1 min intervals ts_plot(rt, "mins") ## examine all Twitter activity using weekly intervals ts_plot(rt, "hours") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.