Skip to content

Commit

Permalink
Handle alpha matrix with only 1 row
Browse files Browse the repository at this point in the history
  • Loading branch information
gaow committed Apr 16, 2024
1 parent 7d8d07a commit 266fe48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/susie_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ susie_get_cs_attainable <- function(res, coverage = 0.95, ethres = 20, ...) {
return(H)
}
# Get attainable coverage
alpha_attainable <- apply(res$alpha, 2, function(x) ifelse(x == max(x), x, 0))
alpha_attainable <- apply(res$alpha, 2, function(x) ifelse(x == max(x), x, 0), simplify = FALSE)

# Calculate the coverage attained
coverage_attained <- rowSums(alpha_attainable)
Expand Down

0 comments on commit 266fe48

Please sign in to comment.