Skip to content

Commit

Permalink
add similarity
Browse files Browse the repository at this point in the history
  • Loading branch information
wincowgerDEV committed Dec 7, 2023
1 parent 5bca717 commit ac76b43
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions R/match_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,27 @@ ai_classify.OpenSpecy <- function(x, library, fill = NULL, ...) {

x
}

# OS Similarity
#' @rdname match_spec
#'
#' @export
os_similarity <- function(x, ...) {
UseMethod("os_similarity")
}

#' @rdname match_spec
#'
#' @export
os_similarity.default <- function(x, ...) {
stop("object 'x' needs to be of class 'OpenSpecy'")
}

#' @rdname match_spec
#'
#' @export
os_similarity.OpenSpecy <- function(x, y, method = "cor_spec", ...) {
if(method = "cor_spec"){
mean(cor_spec(x, y, ...))
}
}

0 comments on commit ac76b43

Please sign in to comment.