Usage
search_tweets(q, n = 100, type = "mixed", max_id = NULL, include_rts = TRUE, parse = TRUE, clean_tweets = FALSE, as_double = FALSE, token = NULL, verbose = TRUE, ...)
Arguments
q
Character, search query of no greater than
500 characters maximum.
n
Numeric, specifying the total number of desired tweets to
return. Defaults to 100. Maximum number of tweets returned from
a single token is 18,000. See details for more information.
type
Character, specifies what type of search results
you would prefer to receive. The current default is
type = "mixed"
, which is a mix between the other two
valid values type = "recent"
and type = "popular"
.
max_id
Character, specifying the [oldest] status id beyond
which results should resume returning.
include_rts
Logical, indicating whether to include retweets
in search results.
parse
Logical, indicating whether to return parsed
(data.frames) or nested list (fromJSON) object. By default,
parse = TRUE
saves users from the time
[and frustrations] associated with disentangling the Twitter
API return objects.
clean_tweets
logical indicating whether to remove non-ASCII
characters in text of tweets. defaults to FALSE.
as_double
logical indicating whether to handle ID variables
as double (numeric) class. By default, this is set to FALSE, meaning
ID variables are treated as character vectors. Setting this to
TRUE can provide performance (speed and memory) boost but can also
lead to issues when printing and saving, depending on the format.
token
OAuth token. By default token = NULL
fetches a
non-exhausted token from an environment variable. Find instructions
on how to create tokens and setup an environment variable in the
tokens vignette (in r, send ?tokens
to console).
verbose
Logical, indicating whether or not to output
processing/retrieval messages.
...
Futher arguments passed on to make_url
.
All named arguments that do not match the above arguments
(i.e., count, type, etc.) will be built into the request.
To return only English language tweets, for example, use
lang = "en"
. For more options see Twitter's
API documentation.