rtweet_net: Create an Igraph Network of Tweets

View source: R/rtweetnet.R

rtweet_netR Documentation

Create an Igraph Network of Tweets

Description

This function creates an igraph network graph from a tibble of tweets details created by rtweet functions (e.g. search_tweets, get_timeline, parse_stream, lookup_statuses, lookup_tweets etc.)

Usage

rtweet_net(
  tweetdf,
  all_mentions = TRUE,
  from_threshold = 0,
  directed_graph = FALSE
)

Arguments

tweetdf

An rtweet tibble of tweets. (90 columns? - depending on version).

all_mentions

Whether to include all the mentions (TRUE/FALSE). Defaults to TRUE, if set to FALSE will include only Replies, Retweets and Quotes (any additional tagged screen_names will be ignored)

from_threshold

A filter to simplify graphs, removes edges where the "from" node has less than a set level of connections. Default is 0.

directed_graph

Directed graph? (TRUE/FALSE), default is FALSE (i.e. undirected graph output)

Examples

tweets <- rtweet::search_tweets("#rstats", n= 100)
network <- rtweet_net(tweets, all_mentions = TRUE, from_threshold =2)
plot(network)

Arf9999/rtweetXtras documentation built on June 27, 2022, 5:10 a.m.