Chat Analysis on WhatsApp: Part 1 — Text Analysis and Data visualization with R

Saúl Buentello
The Startup
Published in
9 min readJul 8, 2020

--

Dashboard to visualize WhatsApp chat data, link at the end of the article

Today, anything we can get data from can be measurable with the right knowledge and tools. WhatsApp is not the exception, thanks to the possibility that it offers us, to export complete conversations.

I want to introduce you to rwhatsapp, a small but very useful package, which provides what is necessary to work with WhatsApp text data in R as Data Frame.

Beginning. How do I export my conversations?

You can export every conversation in a very simple way, from your WhatsApp in any open conversation, from the options menu / More / Export chat. Immediately after this, you can send the complete history as a text file with the extension “.txt”.

The main function in the package is the rwa_read() function, which allows you to import TXT files directly, so you just need to provide the path to a file to load the messages directly as a Data Frame.

For this post, a friend very kindly (whom I thank for the trust) has shared her txt file of the chat with a person with whom she usually has a “casual relationship without commitments” for two years or more. For practical purposes we will analyze this conversation, visualizing some relevant data.

--

--

Saúl Buentello
The Startup

#G3ekArmy, Web Developer & Data Enthusiast. Coordinador académico & Instructor. #KotlinCDMX Organizer. https://www.linkedin.com/in/sbuentello/