calc_self_sim: Calculate a self-similarity matrix

Description Usage Arguments Examples

View source: R/calc_self_sim.R

Description

Calculate the self-similarity matrix for song lyrics.

Usage

1
2
3
4
5
6
7
8
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

1
2
# bad_habits <- genius_lyrics("Alix", "Bad Habits")
# self_sim <- calc_self_sim(bad_habits, lyric)

JosiahParry/geniusR documentation built on Nov. 5, 2021, 11:09 a.m.