powered by
Calculate the self-similarity matrix for song lyrics.
calc_self_sim(df, lyric_col, output = "tidy", remove_stop_words = FALSE, language = "en", source = "snowball")
The data frame containing song lyrics. Usually from the output of `genius_lyrics()`.
`genius_lyrics()`
The unquoted name of the column containing lyrics
Determine the type of output. Default is "tidy". Set to "matrix" for the raw matrix.
"tidy"
"matrix"
Optional argument to remove stop words from self-similarity matrix.
Language of stop words. See tidytext::get_stopwords().
tidytext::get_stopwords()
Stop words source. See tidytext::get_stopwords().
# 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