R/sim_score.R

Defines functions sim_score

#' @export
sim_score <- function(simmat){
  suppressWarnings(scores <- data.frame(
    song2_rel_pos= 1:ncol(simmat) / ncol(simmat),
    song1_match= as.numeric(apply(simmat, 2, which.max)) / nrow(simmat),
    score= apply(simmat, 2, function(x) max(x, na.rm= T))
  ))
  return(scores)
}
crodriguez-saltos/somora documentation built on Feb. 23, 2020, 4:37 a.m.