0

With the Spotify API in R, you can get datasets like this, identifying: album name, key and mode of the key:


data <- tibble::tribble(~track_name,~key_name,~mode_name, 
                        "willow","G","major",
                        "champagne problems","C","major",
                        "gold rush","A","major",
                        "‘tis the damn season","F","major",
                        "tolerate it","A","major",
                        "no body, no crime (feat. HAIM)","G","minor",
                        "happiness","B","major",
                        "dorothea","E","major",
                        "coney island (feat. The National)","G#","major",
                        "ivy","D","major",
                        "cowboy like me","C","major",
                        "long story short","C","major",
                        "marjorie","F","major",
                        "closure","A","major",
                        "evermore (feat. Bon Iver)","C#","major")

And I want to reproduce graphs similar to these found in the book "Visualizing the Beatles":

enter image description here enter image description here

Each point should be the track_name, coloured by the mode_name, but I don't know how to get into polar coords with the key_names and the position of tracks' name.

Paula
  • 497
  • 2
  • 8

1 Answers1

0

here is a simple 'solution' with basis ggplot2. But I this the hardest part will be to get the layout you want desire.

ggplot( data = data, aes( x = track_name, y = key_name, colour = mode_name)) + 
  geom_point() + 
  coord_polar()
Wimpel
  • 26,031
  • 1
  • 20
  • 37