Description Usage Arguments Details Author(s) See Also Examples
getNetwork
retrieves the list of mutual friendships and returns the
adjacency matrix or edge list for the network representing the neighborhood
of the authenticated user.
1 | getNetwork(token, format = "edgelist", verbose = TRUE)
|
token |
Either a temporary access token created at
https://developers.facebook.com/tools/explorer or the OAuth token
created with |
format |
Either "edgelist" for a list of edges in the network or "adj.matrix" for an adjacenty matrix of dimensions (n x n), with n being the number of friends, and 0 or 1 indicating whether friend i is also friends with friend j. |
verbose |
logical, default is |
This function requires the use of an OAuth token with extended permissions.
After the introduction of version 2.0 of the Graph API, only friends who are using the application will be returned.
Pablo Barbera pablo.barbera@nyu.edu
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
## See examples for fbOAuth to know how token was created.
## Copy and paste token created at FB Graph API Explorer
token <- "XXXXXX"
mat <- getNetwork(token=token, format="adj.matrix")
library(igraph)
network <- graph.adjacency(mat, mode="undirected")
pdf("network_plot.pdf")
plot(network)
dev.off()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.