Description Usage Arguments Value Examples
Collect data from the Twitter API and create a follower matrix
1 | follower_matrix(users, method = "friends")
|
users |
A character vector of Twitter handles (with no '@' symbol) or user IDs |
method |
Construct the matrix by gathering either "friends" or "followers" data for each account. "friends" will be faster for accounts with more followers than friends, and vice versa. |
A square matrix representing the directed graph of twitter follower relationships. Each entry in the matrix is 1 if the row account is following the column account, otherwise 0.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
setup_twitter_oauth(consumer_key = "[your info]",
consumer_secret = "[your info]",
access_token = "[your info]",
access_secret = "[your info]")
users = c("c4ssdotorg", "RoderickTLong", "AynRandInst", "AynRandOrg")
m = follower_matrix(users)
# plot with igraph
library(igraph)
g = graph_from_adjacency_matrix(m, "directed")
plot(g)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.