In the run-up to the election last year, Ben Heubl from The Economist used the Emotion API to chart the emotions portrayed by the candidates during the debates (note: auto-play video in that link). In his walkthrough of the implementation, Ben used Python to process the video files, and R to create the charts from the sentiment scores generated by the API.
Now, the learn dplyr blog has recreated the analysis using R. A detailed walkthrough steps through the process of creating a free Emotion API key, submitting a video to the API using the httr package, and retrieving the emotion scores as an R data frame.
With the emotion scores in hand, the blog visualizes the data using exploratory.io, a web-based data exploration GUI based on R. With a few points and clicks (plus a little R code to wrangle the data), Exploratory produced this chart of the emotions expressed by the two candidates over time. (Click for an interactive version.)
For the complete details, including the R code used to interface with the Emotion API, follow the link below.