if (FALSE) {
## search for #rstats tweets
rstats <- search_tweets("#rstats", n = 200)
## create from-to data frame representing retweet/mention/reply connections
rstats_net <- network_data(rstats, "retweet,mention,reply")
## view edge data frame
rstats_net
## view user_id->screen_name index
attr(rstats_net, "idsn")
## if igraph is installed...
if (requireNamespace("igraph", quietly = TRUE)) {
## (1) convert directly to graph object representing semantic network
rstats_net <- network_graph(rstats)
## (2) plot graph via igraph.plotting
plot(rstats_net)
}
}
Run the code above in your browser using DataLab