R/hit_song.R

Defines functions hit_song

Documented in hit_song

#' Hit song generator
#'
#' This function allows you to generate a guaranteed #1 hit with no effort!
#' @param v numeric. Number of lines in the verse.
#' @param c numeric. Number of lines in the chorus.
#' @param b numeric. Number of lines in the bridge.
#' @export hit_song
hit_song <- function(v = 4, c = 4, b = 4){
  lyrics <- tayonce::lyrics
  verse <- sample(lyrics$line, v)
  chorus <- sample(lyrics$line, c)
  bridge <- sample(lyrics$line, b)
  title <- chorus[3]
  song <- c(paste("##",title,"##"), "\n", "\n",
            paste(verse, collapse = "\n"), "\n","\n",
            paste(chorus, collapse = "\n"), "\n", "\n",
            paste(bridge, collapse = "\n"), "\n", "\n",
            paste(chorus, collapse = "\n"))
  return(cat(song))
}
bbartholdy/tayonce documentation built on April 12, 2021, 3:16 a.m.