as_tweet_igraph: Convert Various Objects to 'igraph' graphs.

Description Usage Arguments Author(s) See Also Examples

View source: R/igraph.R

Description

Convert Various Objects to igraph graphs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
as_tweet_igraph(
  x,
  target_class = c("user", "hashtag", "url", "media"),
  all_status_data = FALSE,
  all_user_data = FALSE,
  ...
)

as_igraph(
  x,
  target_class = c("user", "hashtag", "url", "media"),
  all_status_data = FALSE,
  all_user_data = FALSE,
  ...
)

## S3 method for class 'proto_net'
as_tweet_igraph(x, ...)

## S3 method for class 'data.frame'
as_tweet_igraph(
  x,
  target_class = c("user", "hashtag", "url", "media"),
  all_status_data = FALSE,
  all_user_data = FALSE,
  ...
)

Arguments

x

Tweet data frame or proto_net.

target_class

character(1L), Default: "user". The class of nodes to use as the second half of each dyad (target/to/head). See Details.

all_status_data

logical(1L), Default: FALSE. Whether to attach all relevant status data to the edges data frame, which can then be used as edge attributes for downstream tasks.

all_user_data

logical(1L), Default: FALSE. Whether to attach all relevant user data to the nodes data frame, which can then be uses as node attributes for downstream tasks.

...

Arguments passed to or from other methods.

Author(s)

Brendan Knapp brendan.g.knapp@nps.edu

See Also

as_proto_net(), as_tweet_network()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
path_to_tweet_file <- example_tweet_file()
tweet_df <- read_tweets(path_to_tweet_file)

tweet_df %>% 
  as_tweet_igraph()
  
tweet_df %>% 
  as_proto_net() %>% 
  as_tweet_igraph()

tweet_df %>% 
  as_tweet_igraph(all_status_data = TRUE)
  
tweet_df %>% 
  as_tweet_igraph(all_user_data = TRUE)

knapply/tweetio documentation built on Dec. 22, 2020, 7:15 p.m.