add_genius: Add lyrics to a data frame

Description Usage Arguments Examples

View source: R/add_genius.R

Description

This function is to be used to build on a data frame with artist and album/track information. To use the function with a data frame of mixed type (albums and tracks), create another column that specifies type. The type values are '"album"'and '"lyrics"'.

Usage

1
add_genius(data, artist, title, type = c("album", "track", "lyrics"))

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 "track". This tells the function what kind of lyrics to pull. Alternatively, this can be a column with the value of "album" or "track" associated with each row. "lyric" can be used for backward compatibility.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#  # Albums only
#
#  artist_albums <- tibble::tribble(
#   ~artist, ~album,
#   "J. Cole", "KOD",
#   "Sampha", "Process"
# )
#
# add_genius(artist_albums, artist, album, type = "album")
#
#  # Individual Tracks only
#
#  artist_songs <- tibble::tribble(
#   ~artist, ~track,
#   "J. Cole", "Motiv8",
#   "Andrew Bird", "Anonanimal"
#  )
#
#  # Tracks and Albums
#  mixed_type <- tibble::tribble(
#    ~artist, ~album, ~type,
#    "J. Cole", "KOD", "album",
#    "Andrew Bird", "Proxy War", "track"
#  )
#
# add_genius(mixed_type, artist, album, type)
# add_genius(artist_songs, artist, track, type = "track")

genius documentation built on July 24, 2021, 5:06 p.m.

Related to add_genius in genius...