rtweet (version 0.2.0)

get_friends: get_friends

Description

Requests information from Twitter's REST API regarding a user's friend network (i.e., accounts followed by a user). To request information on followers of accounts

Usage

get_friends(user, n = 75000, page = "-1", parse = TRUE, token = NULL)

Arguments

user
Screen name or user id of target user.
n
Number of friends to return. For max return, enter n = "all" or n = 75000 (max per token).
page
Default page = -1 specifies first page of json results. Other pages specified via cursor values supplied by Twitter API response object.
parse
Logical, indicating whether to return parsed vector or nested list (fromJSON) object. By default, parse = TRUE saves you the time [and frustrations] associated with disentangling the Twitter API return objects.
token
OAuth token (1.0 or 2.0). By default token = NULL fetches a non-exhausted token from an environment variable.

Value

friends User ids for everyone a user follows.

See Also

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

Examples

Run this code
## Not run: 
# # get ids of users followed by the president of the US
# pres <- get_friends(user = "potus")
# pres
# 
# # get ids of users followed by the Environmental Protection Agency
# epa <- get_friends(user = "epa")
# epa
# ## End(Not run)

Run the code above in your browser using DataLab