ts_plot: Plots tweets data as a time series-like data object.

Description Usage Arguments Value Examples

View source: R/ts_plot.R

Description

Creates a ggplot2 plot of the frequency of tweets over a specified interval of time.

Usage

1
ts_plot(data, by = "days", trim = 0L, tz = "UTC", ...)

Arguments

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 plot.

Value

If A basic time series plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 

## search for tweets containing "rstats"
rt <- search_tweets("rstats", n = 10000)

## plot frequency in 1 min intervals
ts_plot(rt, "mins")



## End(Not run)

mkearney/rtw documentation built on Dec. 21, 2021, 7:05 p.m.