Learn R Programming

SocialMediaLab (version 0.23.2)

Create: Create networks from social media data

Description

This function creates networks from social media data (i.e. from data frames of class dataSource. Create is the final step of the Authenticate, Collect, Create workflow. This function is a convenient UI wrapper to the core Create*Network family of functions.

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 Twitter networks, the user information can be collected separately using the PopulateUserInfo function and stored into the network as vertex attributes (this involves additional calls to the Twitter API).

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')
## ---------------------------------------------

Run the code above in your browser using DataLab