Created
September 9, 2019 14:51
-
-
Save JosiahParry/610427731304b00317caab25faf4d321 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
track_audio_features <- possibly(.f = { | |
function(artist, title, type = "track") { | |
search_results <- search_spotify(paste(artist, title), type = type) | |
track_audio_feats <- get_track_audio_features(search_results$id[[1]]) %>% | |
dplyr::select(-id, -uri, -track_href, -analysis_url) | |
return(track_audio_feats) | |
}}, otherwise = tibble()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Josiah,
This helped tremendously! I am working on a project that analyzes spotify listening history fora study involving patient directed music with Spotify in patients/families in a pediatric intensive care unit to try to assess music analysis patterns and changes in vital signs, pain, anxiety, and biomarker symptoms of hospital-induced delirium for pediatric patients. This was a crucial point for me to figure out and I greatly appreciate your help and responsiveness. I really like your blog as well, and look forward to learning more about your work. Thanks so much for your contribution to this tool. In another section you mentioned it really opening up the API to use with other sources and it really does.
Sincerely,
Drew