Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/CreateEgoNetwork.R
Create 'ego' networks from social media data
1 2 | CreateEgoNetwork(dataSource, username, userid, verbose, degreeEgoNet,
writeToFile, waitForRateLimit, getFollows)
|
dataSource |
character string, specifying which data source. Currently only "instagram" (default). |
username |
character vector, specifying a set of usernames who will be the 'ego' nodes for the network generation. |
userid |
numeric vector, specifying a set of user ids who will be the 'ego' nodes for the network generation. If usernames are already specified, this argument is ignored. |
verbose |
logical. If |
degreeEgoNet |
Numeric, the 'order' or 'degree' of the ego-network to create (1 is default). 1 = ego + alters. 2 = ego + alters + alters of alters. |
writeToFile |
logical. If |
waitForRateLimit |
logical. If |
getFollows |
Logical, if TRUE (default), also collect who each 'ego' node itself follows (i.e. not just the followers of ego), and integrate these data into the ego network. |
This function creates 'ego' networks from social media data (currently only Instagram). The networks are igraph objects. The user provides a character vector of usernames, and the function collects data about the 'followers' of the users, with options to also collect data about who each user 'follows'. It also provides the ability to specify the 'degree' of the egonet (also sometimes known as the order), currently for 1-degree (ego + alters) or 2-degree (ego + alters + alters of alters of ego).
This function creates a (weighted and directed) 'ego' network from a given set of seed users (the ego nodes).
The resulting network is an igraph graph object.
Note! The network size can become extremely large very quickly, depending on the arguments the user provides to this function. For example, specifying 'degreeEgoNet=2' and 'getFollows=TRUE' can generate very large networks from just a small number of ego users (even just 3 or 4 ego nodes).
An igraph graph object, with directed and weighted edges.
Currently, not all data sources in SocialMediaLab can be used for creating ego networks. Currently only Instagram is implemented.
Timothy Graham <timothy.graham3@uq.net.au> & Robert Ackland <robert.ackland@anu.edu.au>
See CollectDataYoutube
and CollectDataTwitter
to
collect data sources for creating actor networks in SocialMediaLab.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
## Use your own values for myAppID and myAppSecret
myAppID <- "123456789098765"
myAppSecret <- "abc123abc123abc123abc123abc123ab"
# Authenticate with the Instagram API using `AuthenticateWithInstagramAPI`
instagram_oauth_token <- AuthenticateWithInstagramAPI(appID=app_id, appSecret=app_secret,
useCachedToken=TRUE)
myUsernames <- c("senjohnmccain","obama")
g_ego_network <- CreateEgoNetwork(username=myUsernames,verbose=TRUE,degreeEgoNet=1,
writeToFile=FALSE,waitForRateLimit=TRUE,getFollows=FALSE)
# Description of actor network
g_ego_network
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.