Learn R Programming

vosonSML (version 0.23.4)

importData: Import vosonSML data previously saved to disk using the `Collect()` function.

Description

This function imports social media data previously collected and saved to disk using the `Collect()` function in vosonSML. Using this function to import data ensures that the correct classes are applied to the dataframe, in order for vosonSML to know how to handle it (e.g. creating different types of networks using the `Create` function).

Usage

importData(file, dataSource)

Arguments

file

character, specifying the file path to the data to be imported

dataSource

character, the type of social media. Currently supports "facebook", "twitter", "youtube", and "instagram" (not case sensitive).

Value

A dataframe with specific class attributes for vosonSML functionality

See Also

Collect

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
require(magrittr)
## Facebook example

# Specify your API keys
appID <- "xxxx"
appSecret <- "xxxx"

# Authenticate and Collect some data (and save data to disk using `writeToFile=TRUE`)
myFacebookData <- Authenticate("Facebook", appID = appID, appSecret = appSecret) %>%
   Collect(pageName="StarWars", rangeFrom="2015-03-01",
     rangeTo="2015-03-02", writeToFile=TRUE)

# Import the data (that was saved to disk in the previous step)
myStarWarsData <- importData("2015-03-01_to_2015-03-02_StarWars_FacebookData.csv","facebook")

# Create a network using the imported dataframe object
myNetwork <- myStarWarsData %>% Create("Bimodal")
# }

Run the code above in your browser using DataLab