From 17bb02672ab654d7926b15625a0b24610774397b Mon Sep 17 00:00:00 2001 From: Eddie Ruiz <32622519+Ed2uiz@users.noreply.github.com> Date: Sun, 28 Jan 2024 14:39:38 -0500 Subject: [PATCH] fix: add matrix in addition to dgCMatrix in as_ijx() --- R/utils.R | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/R/utils.R b/R/utils.R index 93498f9..e4e5a17 100644 --- a/R/utils.R +++ b/R/utils.R @@ -164,13 +164,11 @@ as_matrix <- function(x){ } #' @title as_ijx -#' @param x dgCMatrix +#' @param x dgCMatrix or matrix #' @noRd as_ijx <- function(x){ - # check that x is a dgCMatrix - if(!inherits(x = x, what = "dgCMatrix")){ - stop("Invalid input. Only dgCMatrix is currently supported.") - } + # check that x is a dgCMatrix or matrix + stopifnot(is(x, "dgCMatrix") || is(x, "matrix")) # Convert dgc into TsparseMatrix class from {Matrix} ijx <- as(x, "TsparseMatrix")