R/get_cove.R

Defines functions get_cove

Documented in get_cove

#' Create a co-occurrence vector (cove)
#'
#' Converts a co-occurrence matrix (coma) to
#' a co-occurrence vector (cove)
#'
#' @param x A matrix - an output of the [get_coma()] function
#' @param ordered The type of pairs considered.
#' Either "ordered" (TRUE) or "unordered" (FALSE).
#' The default is TRUE.
#' @param normalization Should the output vector be normalized?
#' Either "none" or "pdf".
#' The "pdf" option normalizes a vector to sum to one.
#' The default is "none".
#'
#' @return A co-occurrence vector
#' @export
#'
#' @examples
#' library(comat)
#' data(raster_x, package = "comat")
#'
#' com = get_coma(raster_x)
#' com
#'
#' cov = get_cove(com)
#' cov
#'
#' cov = get_cove(com, normalization = "pdf")
#' cov
get_cove = function(x, ordered = TRUE, normalization = "none"){
  rcpp_get_cove(x, ordered, normalization)
}

Try the comat package in your browser

Any scripts or data that you put into this service are public.

comat documentation built on Jan. 13, 2021, 6:20 p.m.