guralbrian / spotify_data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spotify Listening Analysis in R

Written by Brian Gural
README last updated on September 24th 2023

Project Goals

This project is focused on a comprehensive analysis of personal listening habits using Spotify data. Utilizing R and various statistical and data visualization techniques, the project aims to provide insights into trends, preferences, and temporal patterns related to music listening. The ultimate goal is to provide a straighforward method of analyzing one's own Spotify data.

Spotify users can go here to request their own data.

Example Plots

Plot 1

Plot 2

Getting Started

This analysis pipeline is intented to be containerized via Docker. Follow the directions below to carry out the pipeline on your own computer*

*assumes that you have cloned this repo and have docker functioning

Docker

To run the code, build the Docker image and then start an RStudio server:

docker build -t spotify_analysis .

docker run --name=spotify -d -p 8787:8787 -e PASSWORD=pw -v $(pwd):/home/rstudio spotify_analysis

If you'd like to run the code in an interactive session: Open your web browser and go to http://localhost:8787.

Username: rstudio Password: pw

Otherwise, use make to run the scripts for the skeleton analysis:

  • Enter an the docker session with docker exec -it spotify /bin/bash
  • Navigate to our project directory with cd home/rstudio
  • Run scripts with make

Two plots should appear in the results/skeleton directory

To kill the docker container, find the container ID with docker ps -a, then use the container ID in docker kill "container ID".

Note: The docker run line uses the argument -v $(pwd):/home/rstudio to mount the current working directory to the docker container, then make the relative path to it (within the container) /home/rstudio

About


Languages

Language:R 93.8%Language:Shell 3.4%Language:Dockerfile 1.4%Language:Makefile 0.9%Language:Python 0.5%