Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Learning Social Media Analytics with R
Learning Social Media Analytics with R

Learning Social Media Analytics with R: Transform data from social media platforms into actionable business insights

Arrow left icon
Profile Icon Karthik Ganapathy Profile Icon Sarkar Profile Icon Sharma Profile Icon Raghav Bali
Arrow right icon
$54.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (4 Ratings)
Paperback May 2017 394 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Karthik Ganapathy Profile Icon Sarkar Profile Icon Sharma Profile Icon Raghav Bali
Arrow right icon
$54.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (4 Ratings)
Paperback May 2017 394 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Learning Social Media Analytics with R

Chapter 2. Twitter – What's Happening with 140 Characters

An article in Forbes in 2012 outlined research undertaken by a Paris-based analytics firm. The research had found Jakarta to be the world's most active Twitter city (source: http://www.forbes.com/sites/victorlipman/2012/12/30/the-worlds-most-active-twitter-city-you-wont-guess-it/#3b3f7d16343b). This may be a surprise, given the population count and other dynamics of the city, but such insights aren't jaw-dropping any more. The world is now a place where every other person has a virtual identity on numerous social networking platforms. The previous chapter gave you a quick glimpse into what a social network is (in case you didn't already know it) and this chapter will build on those concepts and set the tone for the rest of the book.

Twitter, as we all know, is a chirpy social network that's meant for sharing information at break-neck speeds. Technically, it is a microblogging platform which...

Understanding Twitter

Understanding Twitter

Twitter's initial design. Image source: https://www.flickr.com/photos/jackdorsey/182613360/

Born in 2006, Twitter is a social networking cum online news service which enables its users to share content in bursts of 140 characters. Over the years, it has evolved like any other successful thing on the Internet and added and/or removed features. Our aim in this chapter is to understand different aspects of this service and use them to draw different insights or solve business problems.

Tip

Twitter was the brainchild of Jack Dorsey, Noah Glass, Biz Stone and Evan Williams. It started as the SMS of the Internet with very simple ideas. You can read the interesting story of its inception here: http://latimesblogs.latimes.com/technology/2009/02/twitter-creator.html

As discussed in the previous chapter, social networks are far reaching and dynamic. Twitter allows users to share information using text, images, videos, GIFs, links, hash tags, handles and so on from a variety...

Revisiting analytics workflow

As discussed in detail in Chapter 1, Getting Started with R and Social Media Analytics (see A typical social media analytics workflow), we defined some key steps involved in the analysis of data from different social networks. Continuing with the same theme for Twitter, the different use cases we will work on in the next sections can also be broken down into the following key steps:

  • Data access
  • Data processing and normalization
  • Data analysis
  • Insights

The data access step involves understanding the APIs and their corresponding R packages to tap into the social network. We've already talked about creating a Twitter app and did a quick connect and extraction of tweets using R. Each of the following sections will make use of the same initial step for data access and then build upon them based on the requirements. We will discuss and provide details for each of the other steps in this workflow as we progress with the use cases. Stay tuned.

Trend analysis

Twitter is a speedy medium. Information (along with rumors and nonsense) travels at breakneck speeds across the social network/world. It has now become a norm for an event or news to break first on Twitter and then on any other source of information. It is commonly observed that TV news channels usually play catchup with Twitter during any news breaks. Such a quick spread of information has its own pros and cons, but a discussion of these are out of the scope of this book.

It would be safe to say that if there's anything trending in the connected world, it will be on Twitter first. From brand promotions, sports events, government decisions, election results to news about terror attacks, natural disasters and the notorious fake celebrity death news, Twitter has it all.

Twitter uses search terms, what are called hashtags in Twitter-verse. Any word which begins with a # is termed as a hashtag and instantly becomes searchable on the platform. This not only helps users search...

Sentiment analysis

Twitter timelines are the new battlegrounds for brands, fans and organizations to fight it out and present a winner. Twitter is also a place where users usually rant about their disappointments or share their happiness. The dynamics of human interaction and our urge to share opinionated views on wide ranging topics, from cat pictures to wars and everything in between, have reached an altogether different level.

With its 300 million plus users and counting, Twitter is a virtual country in itself! Its huge user base which generates tweets (or opinions) by the count of millions every minute present a unique opportunity to study and utilize human sentiment and/or opinions. This study of our sentiments and emotion carries a lot more value than just pure academic research (which is, of course, still required by any standards). It carries a lot of business value for companies, governments and celebrities alike.

Before we dive into implementation details and a particular use case...

Follower graph analysis

So far, we have analyzed Twitter and tweets to uncover some interesting insights using techniques and concepts of trend analysis and sentiment analysis. We've utilized different attributes of tweets, like creation time, location and even the text itself, to answer certain questions. In this section, we will touch upon Twitter's network aspects. #BraceYourSelves

A social network is a network or a graph at its core. In formal words, a social network is generally a graph representing its users as nodes (or vertices) linked to each other based on certain relationships called edges. Each social network has its own definition of these relationships. For this section, we will focus on Twitter's relationships and network in general.

In Twitter-verse as we all know, there are no friends! A friend relationship is usually a bidirectional relationship, that is, if A is a friend of B, then it is safe to say that B is also a friend of A (well, usually; see Facebook...

Summary

A tweet is far more than just 140 characters, and Twitter offers quite a lot to play with for a social network. We covered a lot of ground in this chapter by looking at many concepts and solving use cases based on real Twitter data. We learned about different Twitter objects and its APIs. We created an app of our own and utilized R's twitteR package to connect and tap into its APIs. We performed trend analysis to understand how a hashtag is used by tweeple and its temporal affects. We also solved a use case involving sentiment analysis. Through this use case, we first understood the key concepts related to sentiment analysis and then employed them to understand what emotions @POTUS conveys through his tweets. We also performed hierarchical clustering of tweets to visualize common themes using a dendrogram. The final use case analyzed Twitter from a network/graph analysis stand point. We utilized R's different libraries to prepare a network map of followers and perform...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • A practical guide written to help leverage the power of the R eco-system to extract, process, analyze, visualize and model social media data
  • Learn about data access, retrieval, cleaning, and curation methods for data originating from various social media platforms.
  • Visualize and analyze data from social media platforms to understand and model complex relationships using various concepts and techniques such as Sentiment Analysis, Topic Modeling, Text Summarization, Recommendation Systems, Social Network Analysis, Classification, and Clustering.

Description

The Internet has truly become humongous, especially with the rise of various forms of social media in the last decade, which give users a platform to express themselves and also communicate and collaborate with each other. This book will help the reader to understand the current social media landscape and to learn how analytics can be leveraged to derive insights from it. This data can be analyzed to gain valuable insights into the behavior and engagement of users, organizations, businesses, and brands. It will help readers frame business problems and solve them using social data. The book will also cover several practical real-world use cases on social media using R and its advanced packages to utilize data science methodologies such as sentiment analysis, topic modeling, text summarization, recommendation systems, social network analysis, classification, and clustering. This will enable readers to learn different hands-on approaches to obtain data from diverse social media sources such as Twitter and Facebook. It will also show readers how to establish detailed workflows to process, visualize, and analyze data to transform social data into actionable insights.

Who is this book for?

It is targeted at IT professionals, Data Scientists, Analysts, Developers, Machine Learning Enthusiasts, social media marketers and anyone with a keen interest in data, analytics, and generating insights from social data. Some background experience in R would be helpful, but not necessary, since this book is written keeping in mind, that readers can have varying levels of expertise.

What you will learn

  • Learn how to tap into data from diverse social media platforms using the R ecosystem
  • Use social media data to formulate and solve real-world problems
  • Analyze user social networks and communities using concepts from graph theory and network analysis
  • Learn to detect opinion and sentiment, extract themes, topics, and trends from unstructured noisy text data from diverse social media channels
  • Understand the art of representing actionable insights with effective visualizations
  • Analyze data from major social media channels such as Twitter, Facebook, Flickr, Foursquare, Github, StackExchange, and so on
  • Learn to leverage popular R packages such as ggplot2, topicmodels, caret, e1071, tm, wordcloud, twittR, Rfacebook, dplyr, reshape2, and many more
Estimated delivery fee Deliver to Ukraine

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 26, 2017
Length: 394 pages
Edition : 1st
Language : English
ISBN-13 : 9781787127524
Category :
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Ukraine

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : May 26, 2017
Length: 394 pages
Edition : 1st
Language : English
ISBN-13 : 9781787127524
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 164.97
Mastering Machine Learning with R, Second Edition
$54.99
Machine Learning with R Cookbook, Second Edition
$54.99
Learning Social Media Analytics with R
$54.99
Total $ 164.97 Stars icon

Table of Contents

9 Chapters
1. Getting Started with R and Social Media Analytics Chevron down icon Chevron up icon
2. Twitter – What's Happening with 140 Characters Chevron down icon Chevron up icon
3. Analyzing Social Networks and Brand Engagements with Facebook Chevron down icon Chevron up icon
4. Foursquare – Are You Checked in Yet? Chevron down icon Chevron up icon
5. Analyzing Software Collaboration Trends I – Social Coding with GitHub Chevron down icon Chevron up icon
6. Analyzing Software Collaboration Trends II - Answering Your Questions with StackExchange Chevron down icon Chevron up icon
7. Believe What You See – Flickr Data Analysis Chevron down icon Chevron up icon
8. News – The Collective Social Media! Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(4 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Amazon Customer Jun 11, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
One of the few books covering detailed use-cases and analytics on over 5-6 major social media platforms. I have read several books and blogs on social media mining but the current offerings had been lacking based on either content or problems showcased. This one definitely has a lot of examples and code which helps you get started with hands-on analysis yourself. Only con would be I wish there was an equivalent of this book in Python
Amazon Verified review Amazon
Swati Jul 28, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Well structured content with variety of examples and visualizations. Still going through the chapters. Best part: analysis for social networks is not available in other books/blogs eg stack exchange n foursquare
Amazon Verified review Amazon
Dhiraj Baurisetty Jul 19, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Really good book with a very deep insight into R.... Love to recommend it
Amazon Verified review Amazon
Amazon Customer Jun 11, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a good read which covers mining info from multiple social media websites and apps. Really liked the coverage from normal analysis and visualizations to advanced methods like text mining and recommendations. Overall a great book if you are into R and want to analyze data from social websites.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela