Create.activity.twitter: Create twitter activity network

View source: R/Create.activity.twitter.R

Create.activity.twitterR Documentation

Create twitter activity network

Description

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.

Usage

## S3 method for class 'activity.twitter'
Create(datasource, type, rmEdgeTypes = NULL, verbose = FALSE, ...)

Arguments

datasource

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

type

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

rmEdgeTypes

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

verbose

Logical. Output additional information. Default is FALSE.

...

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

Value

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

Examples

## Not run: 
# 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"

## End(Not run)


vosonSML documentation built on Aug. 16, 2022, 5:14 p.m.