genius (version 2.2.0)

calc_self_sim: Calculate a self-similarity matrix

Description

Calculate the self-similarity matrix for song lyrics.

Usage

calc_self_sim(df, lyric_col, output = "tidy",
  remove_stop_words = FALSE, language = "en", source = "snowball")

Arguments

df

The data frame containing song lyrics. Usually from the output of `genius_lyrics()`.

lyric_col

The unquoted name of the column containing lyrics

output

Determine the type of output. Default is "tidy". Set to "matrix" for the raw matrix.

remove_stop_words

Optional argument to remove stop words from self-similarity matrix.

language

Language of stop words. See tidytext::get_stopwords().

source

Stop words source. See tidytext::get_stopwords().

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
bad_habits <- genius_lyrics("Alix", "Bad Habits")
self_sim <- calc_self_sim(bad_habits, lyric)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab