Learn R Programming

spotifyr (version 1.0.0)

get_track_audio_features: Get audio features from one or more tracks on Spotify

Description

This function returns audio features from a dataframe of tracks on Spotify

Usage

get_track_audio_features(tracks, access_token = get_spotify_access_token())

Arguments

tracks

Dataframe containing a column `track_uri`, corresponding to Spotify Album URIs. Can be output from spotifyr::get_album_tracks or spotifyr::get_playlist_tracks()

access_token

Spotify Web API token. Defaults to spotifyr::get_spotify_access_token()

Examples

Run this code
# NOT RUN {
##### Get tracks for all of Radiohead's albums
artists <- get_artists('radiohead')
albums <- get_albums(artists$artist_uri[1])
tracks <- get_album_tracks(albums)
radiohead_audio_features <- get_track_audio_features(tracks)

##### Get tracks for all of Barack Obama's playlists
playlists <- get_user_playlists('barackobama')
tracks <- get_playlist_tracks(playlists)
obama_audio_features <- get_track_audio_features(tracks)
# }

Run the code above in your browser using DataLab