#' Check rows in matrix are all unique
#'
#' @param x matrix
#'
#' @return logical TRUE (the rows are all unique), or FALSE (the rows are not all unique)
#' @export
#'
#' @examples
#'
#' mat <- mnrva_item_matrix(n_items = 5, vec_length = 10)
#' mnrva_check_unique(mat)
#'
mnrva_check_unique <- function(x){
correlations <- cor(t(x))
eval_sum <- sum(correlations[lower.tri(correlations)] == 1)
if(eval_sum == 0) return(TRUE)
if(eval_sum != 0) return(FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.