social media

Sentiment analysis

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. During the 2012 US presidential election, Twitter, in partnership with several polling agencies, launched something called Twitter Political Index. The idea was to track candidates’ popularity among voters based on sentiment expressed in tweets. Back then, such idea was a novelty. Nowadays, sentiment analysis of social media text has been widely applied in marketing/PR, electoral forecasting, and sports analytics.

Visualizing virality

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. We often wonder which user and what kinds of tweets are more viral. In the divided United States of America, a question that may interest many of you is: which political party’s messages attract more attention and positive responses from the public? In the following example, we will analyze 3,197 tweets from @GOP and 2,337 tweets by @TheDemocrats since July 2017.

Make Wordclouds

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. Wordclouds are perhaps the most basic way of representing text data. You can simply use wordclouds to reveal important topics in a large body of tweets or to get a sense of user demographics based on keywords used in Twitter bio pages. Do I need new libraries? Yes, we will use quanteda for creating wordclouds.

Collect YouTube Data

Tufekci (2014) wrote that “Twitter has become to social media scholars what the fruit fly is to biologists—a model organism.” But, let’s not forget that there are so many web platforms out there. Arguably, Facebook provides far richer insights than Twitter given its comparatively larger user base and higher penetration rate around the world. Unfortunately, Facebook has shutted down much of its API, making our previous tutorials on Facebook-based data mining obsolete.

Collect Twitter user info

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. Collecting user information? That sounds creepy! Not at all. We will conduct the data collection in strict compliance with Twitter’s developer terms. In fact, just like the rate limits imposed on collecting tweets, Twitter makes it very limited as to what kind of user profile data are available through its API.

Collect Twitter user timeline

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. What is the rate limit for collecting timeline data According to this Twitter API document, you can get up to 3,200 of a user’s most recent tweets. Scrapping tweets from someone’s timeline is as easy as running the code below. We will get the recent 200 tweets from Elizabeth Warren, a Senator of Massachusetts (@SenWarren).

Collect tweets by keywords/hashtags

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. Collect tweets by keywords/hashtags What Twitter Data are Available? From the previous (post)[https://curiositybits.cc/post/r_analytics2/], you have learned that in order to collect data from Twitter API, you must obtain permission, namely. You probably have also noticed that it is not possible to collect as many tweets as you would like to because Twitter imposes rate limit on each API call.

Connecting to the Twitter API

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. What is Twitter API? API (Application Programming Interface) is a marketplace of data. Twitter makes some of its data publically available and free of access. To obtain the data, you must register a client app and complete the authentification process. Here you will learn how to connect to the Twitter API with pre-obtained credentials: consumer key, consumer secret, access token, and access secret.

Understand R Libraries/Packages

This post is a static and abbreviated version of this interactive tutorial on using R for social data analytics. What is a library/package? Think of R as an operating system (e.g., iOS, Windows) and a library/package as an app running on the system. Each library is designed to accomplish specific tasks. For example, the library ggplot2–which is a library we will use throughout the semester–is for visualizing data, and the library rtweet is used for collecting Twitter data.

Finding Social Media Accounts, Automatically, for A List of Organizations.

This is an old post on medium.com. Click the PDF icon above to download.