ts_data

0th

Percentile

Converts tweets data into time series-like data object.

Returns data containing the frequency of tweets over a specified interval of time.

Usage
ts_data(data, by = "days", trim = 0L)
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

Number of observations to trim off the front and end of each time series

Value

Data frame with time, n, and grouping column if applicable.

Aliases
  • ts_data
Examples
# NOT RUN {
# }
# NOT RUN {
## handles of women senators
sens <- c("SenatorBaldwin", "SenGillibrand", "PattyMurray", "SenatorHeitkamp")

## get timelines for each
sens <- get_timeline(sens, n = 3200)

## get single time series for tweets
ts_data(sens)

## using weekly intervals
ts_data(sens, "weeks")

## group by screen name and then use weekly intervals
sens %>%
  dplyr::group_by(screen_name) %>%
  ts_plot("weeks")

# }
# NOT RUN {
# }
Documentation reproduced from package rtweet, version 0.6.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.