#' get_optimal_abundances
#'
#' @param score_matrix A matrix containing 12C and 14N abundances.
#'
#' @return
#' @export
#'
get_optimal_abundances <-
function(
score_matrix
){
score_matrix_melt <-
reshape2::melt(score_matrix) %>%
tibble::as_tibble()
names(score_matrix_melt) <-
c("14N Abundance", "12C Abundance", "Cosine\nSimilarity")
optimal_12c <-
score_matrix_melt %>%
dplyr::arrange(desc(`Cosine\nSimilarity`)) %>%
dplyr::pull(`12C Abundance`) %>%
dplyr::first()
optimal_14n <-
score_matrix_melt %>%
dplyr::arrange(desc(`Cosine\nSimilarity`)) %>%
dplyr::pull(`14N Abundance`) %>%
dplyr::first()
return(c(optimal_14n, optimal_12c))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.