Creates a twitter activity network from collected tweets. Nodes are tweets and directed edges represent the relationship of tweets to one another. For example, there is a directed edge from a quote tweet towards the tweet that was quoted. Stand-alone tweets that are not replies, retweets or quote tweets have no relation to others and will be isolates.
# S3 method for activity.twitter
Create(datasource, type, rmEdgeTypes = NULL, verbose = FALSE, ...)Collected social media data with "datasource" and "twitter" class names.
Character string. Type of network to be created, set to "activity".
Character vector. List of tweet edge types to remove from network. Options are "tweet",
"retweet", "reply" and "quote". Default is NULL.
Logical. Output additional information. Default is FALSE.
Additional parameters passed to function. Not used in this method.
Network as a named list of two dataframes containing $nodes and $edges.
if (FALSE) {
# create a twitter activity network with retweets removed
activity_net <- twitter_data |>
Create("activity", rmEdgeTypes = c("retweet"))
# network nodes and edges
names(activity_net)
# "nodes", "edges"
names(activity_net$nodes)
# "status_id", "author_id", "author_screen_name", "created_at"
names(activity_net$edges)
# "from", "to", "user_id", "screen_name", "created_at", "edge_type"
}