Learn R Programming

SocialMediaLab (version 0.20.0)

CreateEgoNetworkFromData: Create 'ego' networks from social media data

Description

This function creates 'ego' networks from social media data as a data.frame of class dataSource.*.ego. The networks are igraph objects.

Usage

CreateEgoNetworkFromData(x, writeToFile)

Arguments

x
a data.frame of class dataSource.*.ego
writeToFile
logical. If TRUE then the network is saved to file in current working directory (GRAPHML format), with filename denoting the current date/time and the type of network.

Value

  • An igraph graph object, with directed and weighted edges.

Examples

Run this code
myAppID <- "123456789098765"
myAppSecret <- "abc123abc123abc123abc123abc123ab"
instagram_oauth_token <- AuthenticateWithInstagramAPI(appID=myAppID,
appSecret=myAppSecret, useCachedToken=TRUE)
myUsernames <- c("senjohnmccain","obama")
instagramEgodata <- CollectEgoInstgram(username=myUsernames,
verbose=TRUE,degreeEgoNet=1,
waitForRateLimit=TRUE,getFollows=FALSE)
CreateEgoNetoworkFromData(instagramEgodata)
## the same as Create(instagramEgodata) or Create(instagramEgodata, "ego")

Run the code above in your browser using DataLab