all articles

Reddit

library(tm) ## Loading required package: NLP library(SnowballC) library(stringi) ## Warning: package 'stringi' was built under R version 3.4.4 library(wordcloud) ## Loading required package: RColorBrewer library(RedditExtractoR) # Create search topics of 'italy' and 'france' within Reddit post threads with topic, 'World News'. Subreddit.Topics <- c("World News") Search.Topics <- c("italy", "france") # Get URLS of 'italy' Reddit post threads within 'World News'. reddit_links.italy <- reddit_urls( search_terms = Search.Topics[1], subreddit = Subreddit.Topics, sort_by = "new", page_threshold = 1 ) str(reddit_links. Read more…

Twitter

Load Libraries. # Load libraries. library(twitteR) library(ROAuth) library(tm) ## Loading required package: NLP library(SnowballC) library(stringi) ## Warning: package 'stringi' was built under R version 3.4.4 library(wordcloud) ## Loading required package: RColorBrewer Twitter in R. We first need to authenticate our access to Twitter using the setup_twitter_oath function. I have loaded my credentials contained within the t.api.key and t.api.secret objects. # Authenticate Twitter session load(file = "twitter_credentials") setup_twitter_oauth(t.api.key, t.api.secret, access_token = NULL, access_secret = NULL) ## [1] "Using browser based authentication" # Search for two countries, Italy and France. Read more…
1