Code Monkey home page Code Monkey logo

songs_played's Introduction

Alexa Songs R Shiny Dashboard

This R Shiny dashboard displays data about songs that are played via Amazon Alexa. The data is stored in Google Spreadsheets via an IFTTT application. The dashboard contains four tabs: Frequency Plot, Year to Year Popularity, Top Songs Played, and About. The user can group frequency plots based on four different time units: Day, Week, Month, and Day of Week. The Year to Year Popularity tab contains a bump chart that can be grouped based on the top five most popular Artists or Albums played. The entire dashboard can be filtered with a date range.

Frequency Plots Tab

AlexaListeningHistoryFreqPlots

Year to Year Popularity Tab

AlexaListeningHistoryBumpChart

Top Songs Played Tab

AlexaListeningHistoryTopSongs


Data Provenance:

I played each song via the Amazon Alexa with the voice command, “Alexa, play [genre] music, or Alexa, play music by [artist].” When each song begins playing, the IFTTT application adds a new record to a google sheet using the Keep a Google spreadsheet of the songs you listen to on Alexa applet. The google sheet consists of four columns with no headers (Example below).

Example Record:

Field Value
Date and Time   March 15, 2018 at 06:56PM
Artists Modest Mouse
Song Dashboard
Album We Were Dead Before The Ship Even Sank [Explicit]

I load the google sheet into R using the Google Sheets R API then apply the following transformations to the data:

  • The data frame is given column names (date_time, artist, song, album).
  • Each record in the Date and Time column is converted from a character to a POSIXct date-time object.
  • The artist column is split into two columns (main_artist and featuring).
  • The song and album columns are cleaned to no longer have [Explicit], [Clean], (Album Version), etc tags. This allows for clean, explicit, and live versions of a song or album to be grouped together and counted as the same album.
  • Date, Week_Day, Week, Month, Year, and Time columns are added to the data frame.
  • Skipped songs are removed from the data. If two or more songs contain the same date-time stamp, only the last song is kept.

Resulting Record:

Field Value
date_time 2018-03-15 18:56:00
main_artist   Modest Mouse
featuring NA
song Dashboard
album We Were Dead Before The Ship Even Sank
Date 2018-03-15
Week_Day Thu
Week 11
Month Mar
Time 18:56
Year 2018

Resources:

Two blog posts were tremendously helpful to me while I was working on this project. John Nguyen's college academic rankings bump chart provided the initial inspiration to visualize my listening history with a bump chart. I also found Jay Blanco’s project when researching for similar projects. I particularly like the crisp look of his lollipop charts. Both John and Jay's projects provided helpful code examples of charts I was interested in making for this project.

Package Information

Package Resources
RShiny Package Site
R Googlesheets   RDocumentation, Github
dplyr RDocumentation, Package Site
ggplot2 RDocumentation, Package Site
viridis RDocumentation, Github
ggrepel RDocumentation, Github
datetime RDocumentation
lubridate RDocumentation, Package Site
tidyr RDocumentation, Package Site
rlang RDocumentation, Github
here RDocumentation, Github
markdown RDocumentation, Github
cowplot RDocumentation, Github

songs_played's People

Contributors

sjkrueg avatar

Watchers

 avatar

songs_played's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.