Learn R Programming

rtweet (version 1.2.1)

tweet_counts_recent: Count tweets

Description

Count tweets

Usage

tweet_counts_recent(query, ..., token = NULL, parse = TRUE, verbose = FALSE)

tweet_counts_all(query, ..., token = NULL, parse = TRUE, verbose = FALSE)

Value

The number of tweets for a given granularity

Arguments

query

One query for matching Tweets.

...

Other arguments passed to the API.

token

These endpoints only accept a bearer token (can be created via rtweet_app()). In most cases you are better of changing the default for all calls via auth_as().

parse

If TRUE, the default, returns a tidy data frame. Use FALSE to return the "raw" list corresponding to the JSON returned from the Twitter API.

verbose

A logical value to provide more information about the paginated queries (if any) and to store the data of each page.

References

https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-all

https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent

Examples

Run this code
if (FALSE) {
  tcr <- tweet_counts_recent(query = "#rtweet", parse = FALSE)
  tca <- tweet_counts_all(query = "#rtweet", parse = FALSE)
}

Run the code above in your browser using DataLab