Slide 70
Slide 70 text
!
> library(twitteR)!
!
> setup_twitter_oauth(!
! ! "API key”, "API secret", "Access token", "Access secret”)!
!
> tweets <- searchTwitter('futurelearn', n=100)!
!
> library(“tm”)!
!
> tweet_text <- sapply(tweets, function(x) x$getText())!
> tweet_corpus <- Corpus(VectorSource(tweet_text))!
!
> tweet_corpus <- tm_map(tweet_corpus, ! !
! ! ! ! ! ! ! ! ! content_transformer(tolower))!
> tweet_corpus <- tm_map(tweet_corpus, removePunctuation)!
> tweet_corpus <- tm_map(tweet_corpus, ! ! !
! ! ! ! ! ! ! ! function(x)removeWords(x,stopwords()))