Skip to content

Commit 12b01a6

Browse files
committed
Replacing class(x)==y with inherits(x,y)
1 parent 83eceb8 commit 12b01a6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

R/utils.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ map.CellOntology <- function(object = NULL,
435435
force_update = force_update)
436436

437437
# prepare for seurat objects
438-
if(class(object) == "Seurat"){
438+
if (inherits(object, "Seurat")){
439439
data <- object@meta.data
440-
} else if(class(object) == "data.frame"){
440+
} else if (inherits(object, "data.frame")){
441441
data <- object
442442
} else{
443443
stop("Object should be either a data.frame or a Seurat object")
@@ -467,5 +467,4 @@ map.CellOntology <- function(object = NULL,
467467
} else if(class(object) == "data.frame"){
468468
return(data)
469469
}
470-
471470
}

0 commit comments

Comments
 (0)