rtweet (version 0.3.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, page = "-1", parse = TRUE, token = NULL)

Arguments

user

Screen name or user id of target user.

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. 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).

Value

friends User ids for everyone a user follows.

See Also

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

Other ids: get_followers, next_cursor

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
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace