diff --git a/R/splat-simulate.R b/R/splat-simulate.R index 38bbf7d8760d371c6bea31b4826c84ae24083e3b..6684d2321b31a59efb058d1b88e9a49afa7ef906 100644 --- a/R/splat-simulate.R +++ b/R/splat-simulate.R @@ -356,8 +356,8 @@ splatSimBatchCellMeans <- function(sim, params) { batch.names <- unique(batches) batch.facs.gene <- rowData(sim)[, paste0("BatchFac", batch.names)] - batch.facs.cell <- as.matrix(batch.facs.gene[, factor(batches)]) - + batch.facs.cell <- as.matrix(batch.facs.gene[, + as.numeric(factor(batches))]) } else { nCells <- getParam(params, "nCells") nGenes <- getParam(params, "nGenes")