## [1] "id" "conversation_id" "created_at" "date"
## [5] "time" "timezone" "user_id" "username"
## [9] "name" "place" "tweet" "language"
## [13] "mentions" "urls" "photos" "replies_count"
## [17] "retweets_count" "likes_count" "hashtags" "cashtags"
## [21] "link" "retweet" "quote_url" "video"
## [25] "thumbnail" "near" "geo" "source"
## [29] "user_rt_id" "user_rt" "retweet_id" "reply_to"
## [33] "retweet_date" "translate" "trans_src" "trans_dest"
## [37] "tweet1" "hashtags1" "mentions2" "mentions3"
library(igraph)
library(hrbrthemes)
library(ggraph)
library(tidyverse)
filter(dat, retweets_count > 0) %>%
select(username, mentions3) %>%
unnest(mentions3) %>%
filter(!is.na(mentions3)) %>%
graph_from_data_frame() -> rt_g
V(rt_g)$node_label <- unname(ifelse(degree(rt_g)[V(rt_g)] > 2, names(V(rt_g)), ""))
V(rt_g)$node_size <- unname(ifelse(degree(rt_g)[V(rt_g)] > 2, degree(rt_g), 0))
ggraph(rt_g, layout = 'linear', circular = TRUE) +
geom_edge_arc(edge_width=0.125, aes(alpha=..index..)) +
geom_node_label(aes(label=node_label, size=node_size),
label.size=0, fill="#ffffff66", segment.colour="springgreen",
color="slateblue", repel=TRUE, fontface="bold") +
coord_fixed() +theme_bw()+
theme(axis.title=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank())+
scale_size_area(trans="sqrt") +
theme(legend.position="none")

## tibble [200 × 40] (S3: tbl_df/tbl/data.frame)
## $ id : num [1:200] 1.34e+18 1.34e+18 1.34e+18 1.34e+18 1.34e+18 ...
## $ conversation_id: num [1:200] 1.34e+18 1.34e+18 1.34e+18 1.34e+18 1.34e+18 ...
## $ created_at : chr [1:200] "2020-12-12 17:21:11 CST" "2020-12-12 16:54:24 CST" "2020-12-12 08:41:42 CST" "2020-12-12 04:59:35 CST" ...
## $ date : POSIXct[1:200], format: "2020-12-12" "2020-12-12" ...
## $ time : POSIXct[1:200], format: "1899-12-31 17:21:11" "1899-12-31 16:54:24" ...
## $ timezone : num [1:200] -600 -600 -600 -600 -600 -600 -600 -600 -600 -600 ...
## $ user_id : num [1:200] 9.97e+17 4.83e+07 1.01e+18 2.89e+09 9.58e+17 ...
## $ username : chr [1:200] "smythekin" "tombamonte" "idugrp" "kellyalspals" ...
## $ name : chr [1:200] "Michael Ekin Smyth" "Thomas Bamonte" "IDU GROUP" "chris kelly" ...
## $ place : chr [1:200] NA NA NA NA ...
## $ tweet : chr [1:200] "@stevol321 Autonomous delivery vehicles are now allowed in San Francisco. Lidar, a form of radar, allows them t"| __truncated__ ".@RefractionAI, the robotics startup in Ann Arbor and creator of the REV-1, a lightweight autonomous delivery r"| __truncated__ "IDU will be participating in the virtual Technology and Smart Cities Trade Mission to Saudi Arabia through the "| __truncated__ "love this. Pennsylvania legalizes autonomous delivery robots, classifies them as pedestrians https://t.co/aGw2i76eFY" ...
## $ language : chr [1:200] "en" "en" "en" "en" ...
## $ mentions : chr [1:200] "[]" "[{'screen_name': 'refractionai', 'name': 'refraction ai', 'id': '1145761720171974656'}, {'screen_name': 'dbusin"| __truncated__ "[]" "[]" ...
## $ urls : chr [1:200] "[]" "['https://www.dbusiness.com/people/refraction-al-announces-luke-schneider-as-ceo/']" "[]" "['https://www.pghcitypaper.com/pittsburgh/pennsylvania-legalizes-autonomous-delivery-robots-classifies-them-as-"| __truncated__ ...
## $ photos : chr [1:200] "[]" "[]" "['https://pbs.twimg.com/media/EpC2WydW8AABbLT.jpg']" "[]" ...
## $ replies_count : num [1:200] 1 0 0 0 0 0 0 0 0 1 ...
## $ retweets_count : num [1:200] 0 0 0 0 0 0 0 0 0 0 ...
## $ likes_count : num [1:200] 0 0 1 0 1 0 0 0 0 1 ...
## $ hashtags : chr [1:200] "[]" "[]" "[]" "[]" ...
## $ cashtags : chr [1:200] "[]" "[]" "[]" "[]" ...
## $ link : chr [1:200] "https://twitter.com/SmythEkin/status/1337900332911759360" "https://twitter.com/TomBamonte/status/1337893593755901957" "https://twitter.com/IDUGRP/status/1337769602034622465" "https://twitter.com/KellyAlspals/status/1337713706482823170" ...
## $ retweet : logi [1:200] FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ quote_url : chr [1:200] NA NA NA NA ...
## $ video : num [1:200] 0 0 1 0 0 0 1 0 0 0 ...
## $ thumbnail : chr [1:200] NA NA "https://pbs.twimg.com/media/EpC2WydW8AABbLT.jpg" NA ...
## $ near : logi [1:200] NA NA NA NA NA NA ...
## $ geo : logi [1:200] NA NA NA NA NA NA ...
## $ source : logi [1:200] NA NA NA NA NA NA ...
## $ user_rt_id : logi [1:200] NA NA NA NA NA NA ...
## $ user_rt : logi [1:200] NA NA NA NA NA NA ...
## $ retweet_id : logi [1:200] NA NA NA NA NA NA ...
## $ reply_to : chr [1:200] "[{'screen_name': 'stevol321', 'name': 'truthdriver', 'id': '811826520'}]" "[]" "[]" "[]" ...
## $ retweet_date : logi [1:200] NA NA NA NA NA NA ...
## $ translate : logi [1:200] NA NA NA NA NA NA ...
## $ trans_src : logi [1:200] NA NA NA NA NA NA ...
## $ trans_dest : logi [1:200] NA NA NA NA NA NA ...
## $ tweet1 : chr [1:200] "stevol321 autonomous delivery vehicles are now allowed in san francisco lidar a form of radar allows them to se"| __truncated__ "refractionai the robotics startup in ann arbor and creator of the rev1 a lightweight autonomous delivery robot "| __truncated__ "idu will be participating in the virtual technology and smart cities trade mission to saudi arabia through the "| __truncated__ "love this pennsylvania legalizes autonomous delivery robots classifies them as pedestrians" ...
## $ hashtags1 : chr [1:200] "" "" "" "" ...
## $ mentions2 : chr [1:200] "" "screenname refractionai name refraction ai id 1145761720171974656 screenname dbusiness name dbusiness magazine id 21400091" "" "" ...
## $ mentions3 :List of 200
## ..$ : chr(0)
## ..$ : chr [1:2] "refractionai" "dbusiness"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr "intengineering"
## ..$ : chr [1:12] "selfdrivingvehi" "andyfitze" "jenstirrup" "fisheyeboxindia" ...
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:2] "ford" "argoai"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:12] "" "fmfrancoise" "haroldsinnott" "joshinishadblog" ...
## ..$ : chr "walmart"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:2] "educationfund" "ford"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:5] "mohuaindia" "utmohua" "smartcitieshua" "cdiaasia" ...
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:2] "ryandeto" "pghcitypaper"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:2] "cruise" "walmart"
## ..$ : chr(0)
## ..$ : chr [1:2] "gatikai" "loblawco"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:2] "wrapify" "kiwicampus"
## ..$ : chr "intengineering"
## ..$ : chr "elonmusk"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr "driverlessnow"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr [1:2] "unmannedlife" "oxfordshirecc"
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr ""
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## ..$ : chr(0)
## .. [list output truncated]
## [1] "id" "conversation_id" "created_at" "date"
## [5] "time" "timezone" "user_id" "username"
## [9] "name" "place" "tweet" "language"
## [13] "mentions" "urls" "photos" "replies_count"
## [17] "retweets_count" "likes_count" "hashtags" "cashtags"
## [21] "link" "retweet" "quote_url" "video"
## [25] "thumbnail" "near" "geo" "source"
## [29] "user_rt_id" "user_rt" "retweet_id" "reply_to"
## [33] "retweet_date" "translate" "trans_src" "trans_dest"
## [37] "tweet1" "hashtags1" "mentions2" "mentions3"
## [41] "mentions4"
## Rows: 10
## Columns: 3
## $ username <chr> "ieeefuturedir", "vincentsuppe", "vision_asset", "kitmuelle…
## $ mentions4 <chr> "intengineering", "cryandeto pghcitypaper", "intengineering…
## $ count <int> 2, 2, 2, 2, 4, 4, 2, 2, 4, 4
## # A tbl_graph: 12 nodes and 10 edges
## #
## # An undirected multigraph with 4 components
## #
## # Node Data: 12 x 2 (active)
## name centrality
## <chr> <dbl>
## 1 ieeefuturedir 0
## 2 vincentsuppe 0
## 3 vision_asset 0
## 4 kitmueller 0
## 5 quantumbusicomm 0
## 6 business_ai 0
## # … with 6 more rows
## #
## # Edge Data: 10 x 2
## from to
## <int> <int>
## 1 1 9
## 2 2 10
## 3 3 9
## # … with 7 more rows
