Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
R Data Analysis Projects

You're reading from   R Data Analysis Projects Build end to end analytics systems to get deeper insights from your data

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781788621878
Length 366 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Gopi Subramanian Gopi Subramanian
Author Profile Icon Gopi Subramanian
Gopi Subramanian
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Association Rule Mining 2. Fuzzy Logic Induced Content-Based Recommendation FREE CHAPTER 3. Collaborative Filtering 4. Taming Time Series Data Using Deep Neural Networks 5. Twitter Text Sentiment Classification Using Kernel Density Estimates 6. Record Linkage - Stochastic and Machine Learning Approaches 7. Streaming Data Clustering Analysis in R 8. Analyze and Understand Networks Using R

Twitter text


We will leverage the twitteR package to extract tweets. Refer to https://cran.r-project.org/web/packages/twitteR/index.html to get more information about this package.

In order to use this package, you need a Twitter account. With the account, sign in to https://app.twitter.com and create an application. Use the consumer key, consumer secret key, access token, and access token security keys from that page to authenticate into Twitter.

Authorizing with keys into Twitter is done as follows:

library(twitteR, quietly = TRUE)
setup_twitter_oauth(consumer.key, consumer.secret, access.token, token.secret)

We are ready to extract some tweets.

We will retrieve only the English tweets using the searchTwitter function provided by the twitteR package:

tweet.results <- searchTwitter("@apple", n=1000,lang = "en")
tweet.df <- twListToDF(tweet.results)

Using the function twListToDF, we convert our extracted tweets from Twitter to a dataframe, tweet.df. Out of all the fields extracted, we are...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image