getUser: Functions to manage Twitter users

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These functions allow you interact with information about a Twitter user - retrieving their base information, list of friends, list of followers, and an up to date timeline.

Usage

1
2
getUser(user, ...)
lookupUsers(users, includeNA=FALSE, ...)

Arguments

user

The Twitter user to detail, can be character or an user object.

users

A vector of either user IDs or screen names or a mix of both

includeNA

If TRUE will leave an NA element in the return list for users that don't exist

...

Optional arguments to be passed to GET

Details

These functions will only return fully formed objects if the authenticated user is allowed to see the requested user. If that person has a private account and has not allowed you to see them, you will not be able to extract that information.

The lookupUsers function should be used in cases where there are multiple lookups going to take place, to reduce the API call load. This function requires OAuth authentication.

Value

The getUser function returns an object of class user.

The lookupUsers function will return a list of user objects, sorted in the order of the users argument, with names being the particular element of users that it matches to. If the includeNA argument is set to FALSE (default), any non-existing users will be dropped from the list.

Author(s)

Jeff Gentry

See Also

mentions

Examples

1
2
3
4
5
      ## Not run: 
        tuser <- getUser('geoffjentry')
        users <- lookupUsers(c('geoffjentry', 'whitehouse'))
      
## End(Not run)

twitteR documentation built on May 2, 2019, 6:46 a.m.