You are previewing Social Media Mining with R.
O'Reilly logo
Social Media Mining with R

Book Description

There’s probably no better place to gain behavioral insights than through social media, but analyzing the mass of data is often difficult. With this book you’ll learn to employ the latest techniques and processes using R.

In Detail

The growth of social media over the last decade has revolutionized the way individuals interact and industries conduct business. Individuals produce data at an unprecedented rate by interacting, sharing, and consuming content through social media. However, analyzing this ever-growing pile of data is quite tricky and, if done erroneously, could lead to wrong inferences.

By using this essential guide, you will gain hands-on experience with generating insights from social media data. This book provides detailed instructions on how to obtain, process, and analyze a variety of socially-generated data while providing a theoretical background to help you accurately interpret your findings. You will be shown R code and examples of data that can be used as a springboard as you get the chance to undertake your own analyses of business, social, or political data.

The book begins by introducing you to the topic of social media data, including its sources and properties. It then explains the basics of R programming in a straightforward, unassuming way. Thereafter, you will be made aware of the inferential dangers associated with social media data and how to avoid them, before describing and implementing a suite of social media mining techniques.

Social Media Mining in R provides a light theoretical background, comprehensive instruction, and state-of-the-art techniques, and by reading this book, you will be well equipped to embark on your own analyses of social media data.

What You Will Learn

  • Learn the basics of R and all the data types
  • Explore the vast expanse of social science research
  • Discover more about data potential, the pitfalls, and inferential gotchas
  • Gain an insight into the concepts of supervised and unsupervised learning
  • Familiarize yourself with visualization and some cognitive pitfalls
  • Delve into exploratory data analysis
  • Understand the minute details of sentiment analysis
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

    Table of Contents

    1. Social Media Mining with R
      1. Table of Contents
      2. Social Media Mining with R
      3. Credits
      4. About the Authors
      5. About the Reviewers
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Going Viral
        1. Social media mining using sentiment analysis
        2. The state of communication
        3. What is Big Data?
        4. Human sensors and honest signals
        5. Quantitative approaches
        6. Summary
      9. 2. Getting Started with R
        1. Why R?
        2. Quick start
          1. The basics – assignment and arithmetic
          2. Functions, arguments, and help
        3. Vectors, sequences, and combining vectors
        4. A quick example – creating data frames and importing files
        5. Visualization in R
        6. Style and workflow
        7. Additional resources
        8. Summary
      10. 3. Mining Twitter with R
        1. Why Twitter data?
        2. Obtaining Twitter data
        3. Preliminary analyses
        4. Summary
      11. 4. Potentials and Pitfalls of Social Media Data
        1. Opinion mining made difficult
        2. Sentiment and its measurement
        3. The nature of social media data
        4. Traditional versus nontraditional social data
        5. Measurement and inferential challenges
        6. Summary
      12. 5. Social Media Mining – Fundamentals
        1. Key concepts of social media mining
        2. Good data versus bad data
        3. Understanding sentiments
          1. Scherer's typology of emotions
        4. Sentiment polarity – data and classification
        5. Supervised social media mining – lexicon-based sentiment
        6. Supervised social media mining – Naive Bayes classifiers
        7. Unsupervised social media mining – Item Response Theory for text scaling
        8. Summary
      13. 6. Social Media Mining – Case Studies
        1. Introductory considerations
        2. Case study 1 – supervised social media mining – lexicon-based sentiment
        3. Case study 2 – Naive Bayes classifier
        4. Case study 3 – IRT models for unsupervised sentiment scaling
        5. Summary
      14. A. Conclusions and Next Steps
        1. Final thoughts
        2. An expanding field
        3. Further reading
        4. Bibliography
      15. Index