rtweet (version 0.3.0)

search_users: search_users

Description

Returns data frame of users data using a provided search query.

Usage

search_users(q, n = 20, parse = TRUE, token = NULL, verbose = TRUE)

Arguments

q

Character, search query of no greater than 500 characters maximum.

n

Numeric, specifying the total number of desired users to return. Defaults to 100. Maximum number of users returned from a single search is 1,000.

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.

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.

Value

Data frame of users returned by query.

See Also

https://dev.twitter.com/overview/documentation

Other users: lookup_users, users_data

Examples

Run this code
# NOT RUN {
# search for 1000 tweets mentioning Hillary Clinton
pc <- search_users(q = "political communication", n = 1000)

# data frame where each observation (row) is a different user
pc

# tweets data also retrieved. can access it via tweets_data()
users_data(hrc)
# }

Run the code above in your browser using DataCamp Workspace