vosonSML (version 0.32.7)

Create.actor.twitter: Create twitter actor network

Description

Creates a twitter actor network from tweets returned from the twitter search query. Twitter users who have tweeted, retweeted or been mentioned in a tweet are actor nodes. The created network is directed with edges of different types representing retweets, quote tweets, mentions and replies to other users. Users who have tweeted without ties to other users will appear in the network graph as nodes with self-loops.

Usage

# S3 method for actor.twitter
Create(
  datasource,
  type,
  rmEdgeTypes = NULL,
  inclMentions = TRUE,
  inclRtMentions = FALSE,
  verbose = FALSE,
  ...
)

Value

Network as a named list of two dataframes containing $nodes and $edges.

Arguments

datasource

Collected social media data with "datasource" and "twitter" class names.

type

Character string. Type of network to be created, set to "actor".

rmEdgeTypes

Character vector. List of edge types to remove from network. Options are "tweet", "retweet", "reply" and "quote". Default is NULL.

inclMentions

Logical. Create edges for users mentioned or tagged in tweets. Default is TRUE.

inclRtMentions

Logical. Create edges for users mentioned or tagged in retweets. For tweet types other than retweets the collected tweet author has created the mention, for retweets the original tweet author has created the mention not the retweeter. Default is FALSE.

verbose

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

...

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

Examples

Run this code
if (FALSE) {
# create a twitter actor network excluding retweet, quote tweets and mention edges
actor_net <- twitter_data |>
  Create("actor", rmEdgeTypes = c("retweet", "quote"))

# network nodes and edges
names(actor_net)
# "nodes", "edges"
names(actor_net$nodes)
# "user_id", "screen_name"
names(actor_net$edges)
# "from", "to", "status_id", "created_at", "edge_type"
}

Run the code above in your browser using DataLab