genius (version 2.2.0)

add_genius: Add lyrics to a data frame

Description

This function is to be used to build on a data frame with artist and album/track information. Ideal via the spotifyr package.

Usage

add_genius(data, artist, title, type = "album")

Arguments

data

This is a dataframe with one column for the artist name, and the other column being either the track title or the album title.

artist

This is the column which has artist title information

title

This is the column that has either album titles, track titles, or both.

type

This is a single value character string of either "album" or "lyrics". This tells the function what kind of lyrics to pull. Alternatively, this can be a column with the value of "album" or "lyrics" associated with each row.

Examples

Run this code
# NOT RUN {
artist_albums <- tribble(
 ~artist, ~album,
 "J. Cole", "KOD",
 "Sampha", "Process"
)


artist_albums %>%
 add_genius(artist, album)

artist_songs <- tribble(
 ~artist, ~track,
 "J. Cole", "Motiv8",
 "Andrew Bird", "Anonanimal"
)

artist_songs %>%
 add_genius(artist, track, type = "lyrics")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab