Skip to content

Commit

Permalink
nrow on vector
Browse files Browse the repository at this point in the history
Illegal immigrants Al-Shabaab Duress Gunfight mania Echelon Venezuela
BART ASDIC Burst Glock U.S. Consulate ARC BMDO Jiang Zemin
  • Loading branch information
benjamin-james committed May 20, 2024
1 parent 118a815 commit b107e80
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/deg.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ deg.dysregulation <- function(sce, pathology, sample.col, covariates=NULL, verb
require(glmnet)
Y = as.integer(as.factor(cd[[pathology]])) > 1
weights = numeric(length(Y))
f0 = rep(1 - sum(Y == 0) / nrow(Y), sum(Y == 0))
f1 = rep(1 - sum(Y == 1) / nrow(Y), sum(Y == 1))
weights[Y == 0] = f0
weights[Y == 1] = f1
weights[Y == 0] = 1 - sum(Y == 0) / length(Y)
weights[Y == 1] = 1 - sum(Y == 1) / length(Y)
cat("Y:\n")
print(table(Y))
cat("X:\n")
Expand Down

0 comments on commit b107e80

Please sign in to comment.