Description Usage Arguments Value Author(s) See Also Examples
This function imports social media data previously collected and saved to disk using the 'Collect()' function in SocialMediaLab. Using this function to import data ensures that the correct classes are applied to the dataframe, in order for SocialMediaLab to know how to handle it (e.g. creating different types of networks using the 'Create' function).
1 | importData(file, dataSource)
|
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). |
A dataframe with specific class attributes for SocialMediaLab functionality
Timothy Graham <timothy.graham3@uq.net.au>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## 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")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.