Learn R Programming

vosonSML (version 0.23.4)

Collect: Collect data from social media for generating networks

Description

This function collects data from social media APIs, and structures the data into a data frame of class dataSource.*, ready for creating networks for further analysis. Collect is the second step of the Authenticate, Collect, Create workflow. This function is a convenient UI wrapper to the core CollectDataFrom* family of functions.

Usage

Collect(credential, ego = FALSE, ...)

Arguments

credential

credential object generated from Authenticate

ego

logical, collecting ego network data. Currently only support Instagram.

...

additional parameters for data collection (refer to CollectDataFrom* and CollectEgo* functions)

facebook: pageName, rangeFrom, rangeTo, verbose, n, writeToFile, dynamic

youtube: videoIDs, verbose, writeToFile, maxComments

twitter: searchTerm, numTweets, verbose, writeToFile, language

instagram: credential, tag, n, lat, lng, distance, folder, mindate, maxdate, verbose, sleep, writeToFile, waitForRateLimit

instagram with ego = TRUE: username, userid, verbose, degreeEgoNet, waitForRateLimit, getFollows

Value

A data.frame object of class dataSource.* that can be used with Create.

See Also

CollectDataFromFacebook, CollectDataFromInstagram, CollectDataFromYoutube, CollectDatFromTwitter, CollectEgoInstagram

Examples

Run this code
# NOT RUN {
# }
# 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