Skip to content

Commit 66073b7

Browse files
fixed zero low counts bug caused by depenency update
1 parent b539746 commit 66073b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

R/calculations.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,11 @@ zero_low_counts <- function(obj, data, min_count = 2, use_total = FALSE,
416416
} else {
417417
my_print('No counts found less than ', min_count, '.')
418418
}
419-
count_table[to_zero] <- 0
419+
count_table[seq_len(ncol(to_zero))] <- lapply(seq_len(ncol(to_zero)), function(i) {
420+
out <- count_table[[i]]
421+
out[to_zero[, i]] <- 0
422+
out
423+
})
420424
}
421425
names(count_table) <- as.character(groups) # needed because do_calc_on_num_cols assumes column named by groups even though this function does not use groups currently
422426
return(count_table)

0 commit comments

Comments
 (0)