Learn R Programming

SocialMediaLab (version 0.22.0)

Create: Create networks from social media data

Description

This function creates network from social media data (i.e. from data frames of class dataSource. Create is the final step of the Authenticate, Collect, Create workflow.

Usage

Create(dataSource, type = "Actor", ...)

Arguments

dataSource
a data frame of class dataSource
type
character, type of network to be created, currently supports "actor", "bimodal", "dynamic", "semantic" and "ego"
...
additional parameters for Create*Network functions

Value

An igraph graph object

Details

Note: when creating Facebook *bimodal* networks, the user information is also collected and stored as vertex attributes (involving additional calls to the Facebook API). However, this is not currently implemented for Facebook *actor* networks.

See Also

CreateActorNetwork, CreateBimodalNetwork, CreateDynamicNetwork, CreateSemanticNetwork, CreateEgoNetworkFromData

Examples

Run this code
## Not run: 
# require(magrittr)
# ## Instagram ego network example
# myAppID <- "123456789098765"
# myAppSecret <- "abc123abc123abc123abc123abc123ab"
# myUsernames <- c("senjohnmccain","obama")
# 
# Authenticate("instagram",
# appID = myAappId,
# appSecret = myAppSecret) %>% Collect(ego = TRUE,
# username = myUsernames) %>% Create
# 
# ## YouTube actor network example
# my_apiKeyYoutube <- "314159265358979qwerty"
# videoIDs <- c("W2GZFeYGU3s","mL27TAJGlWc")
# 
# Authenticate("youtube",
# apiKey = my_apiKeyYoutube) %>% Collect(videoIDs = videoIDs) %>% Create('actor')
# ## End(Not run)

Run the code above in your browser using DataLab