R/as_weights_matrix.R

Defines functions as_weights_matrix.matrix as_weights_matrix

Documented in as_weights_matrix

#' Convert an object to a weights matrix
#'
#' This function converts non-`weights_matrix` objects into `weights_matrix`
#' class objects.
#'
#' @param x The object to convert into a data list.
#' @return A `weights_matrix` class object.
#' @export
as_weights_matrix <- function(x) {
    UseMethod("as_weights_matrix")
}

#' @export
as_weights_matrix.matrix <- function(x) {
    x <- validate_weights_matrix(x)
    x <- new_weights_matrix(x)
    return(x)
}

Try the metasnf package in your browser

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

metasnf documentation built on April 3, 2025, 5:40 p.m.