Network is supplemented with additional downloaded user information applied as actor node attributes.

# S3 method for actor.twitter
AddUserData(
  net,
  data,
  lookupUsers = FALSE,
  twitterAuth = NULL,
  verbose = TRUE,
  ...
)

Arguments

net

A named list of dataframes nodes and edges generated by Create.

data

A dataframe generated by Collect.

lookupUsers

Logical. Lookup user profile information using the twitter API for any users data missing from the collect data set. For example fetches profile information for users that became nodes during network creation because they were mentioned in a tweet but did not author any tweets themselves. Default is FALSE.

twitterAuth

A twitter authentication object from Authenticate.

verbose

Logical. Output additional information about the network creation. Default is TRUE.

...

Additional parameters passed to function. Not used in this method.

Value

Network as a named list of two dataframes containing $nodes, $edges and $users. Nodes include columns for additional user data.

Note

Using the standard twitter API this function is limited to collecting profiles of 90000 users per 15 mins before hitting the rate limit. It does not wait and retry upon hitting rate limit.

Examples

if (FALSE) { # add user info to a twitter actor network actor_net <- twitter_data %>% Create("actor") %>% AddUserData(twitter_data, lookupUsers = TRUE, twitterAuth = twitter_auth) # network names(actor_net) # "nodes", "edges" names(actor_net$nodes) # "name", "screen_name", "display_name", "location" # "description", "url", "protected", "followers_count" # "friends_count", "listed_count", "statuses_count", "favourites_count" # "account_created_at", "verified", "profile_url", "profile_expanded_url" # "account_lang", "profile_banner_url", "profile_background_url", "profile_image_url" }