Skip to content

Commit

Permalink
fix: add matrix in addition to dgCMatrix in as_ijx()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed2uiz committed Jan 28, 2024
1 parent a0d25a9 commit 17bb026
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 17bb026

Please sign in to comment.