Skip to contents

Creates a tbl_graph object from a tibble containing retweets and original authors.

Usage

make_retweet_network(dataset, from, to, size, colour)

Arguments

dataset

A tibble where each row is a separate post.

from

The variable containing the original authors of a post.

to

The variable containing authors who retweeted the post.

size

The variable which should be represented by node size.

colour

The variable which should be represented by node colour.

Value

A tbl_graph object containing a nodes tibble and an edges tibble.

Examples

make_retweet_network(
 dataset = retweet_example,
 from = OriginalAuthor,
 to = sender_handle,
 size = followers,
 colour = Score
) 
#> # A tbl_graph: 870 nodes and 921 edges
#> #
#> # A directed multigraph with 32 components
#> #
#> # Node Data: 870 × 3 (active)
#>    node_name      mean_followers mean_Score
#>    <chr>                   <dbl>      <dbl>
#>  1 31pankaj92                  3    -0.124 
#>  2 87retweets               2574    -0.0982
#>  3 960sutton                1300    -0.111 
#>  4 AAEON                      NA    NA     
#>  5 ADLINK_IoT              26385     0.141 
#>  6 ADLINK_Tech              1683    -0.107 
#>  7 AD_STPI                    63    -0.123 
#>  8 AI_ValueChains             89    -0.123 
#>  9 AMarathonMan              829    -0.116 
#> 10 ATrullols                 233    -0.122 
#> # ℹ 860 more rows
#> #
#> # Edge Data: 921 × 3
#>    from    to n_retweets
#>   <int> <int>      <int>
#> 1     4   115          1
#> 2    12   502          1
#> 3    12   610          1
#> # ℹ 918 more rows