Visualizing Sound

My sister’s boyfriend’s band, Vertigo Drift, recently came out with a new EP called Phase 3. It seemed like the perfect excuse for me to play around with gganimate to create a music video. Reading Audio Files The tuneR package provides excellent functions for reading audio files. Let’s download an example wave file. url <- "http://freewavesamples.com/files/Alesis-Fusion-Acoustic-Bass-C2.wav" command <- paste("wget", url) system(command) Let’s use tuneR to read the file. library(tuneR) wave <- readWave("Alesis-Fusion-Acoustic-Bass-C2....

November 1, 2017 · 2 min · Andrew Marder

Trump vs Obama - a Battle of Words

This post applies natural language processing, machine learning, and data visualization to examine how word usage differs between Donald Trump and Barack Obama. I employ a number of excellent R libraries to download tweets, clean the associated text, and predict authorship based on word choice. Downloading Data The twitteR library makes it easy to download tweets through the Twitter API. To access Twitter’s API you need to create a new app using Twitter Application Management....

September 29, 2017 · 3 min · Andrew Marder

Custom Web Analytics

Piwik is the web analytics framework for hackers. By providing access to raw page view data, Piwik allows analysts to use general purpose tools for analysis. Piwik stores all of its data in a MySQL database. I’ve written an R library piwikr to download and clean the tables stored in Piwik’s database. To get started let’s connect to the database: library(piwikr) my_db <- src_mysql( host = "host.com", user = "andrew", password = "xxxxx", dbname = "piwik" ) Below I retrieve tables describing all visits to the site and all actions taken by visitors to the site....

June 16, 2016 · 2 min · Andrew Marder