Skip to content

Commit

Permalink
Correctly fix method and add import
Browse files Browse the repository at this point in the history
  • Loading branch information
alanocallaghan committed Mar 11, 2024
1 parent 845dc23 commit 480bf74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ importFrom(stats,lag)
importFrom(stats,lm)
importFrom(stats,median)
importFrom(stats,model.matrix)
importFrom(stats,na.omit)
importFrom(stats,quantile)
importFrom(stats,rgamma)
importFrom(stats,rlnorm)
Expand Down
4 changes: 3 additions & 1 deletion R/Methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ setMethod(
#'
#' @author Catalina A. Vallejos \email{cnvallej@@uc.cl}
#' @author Nils Eling \email{eling@@ebi.ac.uk}
#' @importFrom stats na.omit
#' @export
setMethod("Summary",
signature = "BASiCS_Chain",
Expand All @@ -156,7 +157,8 @@ setMethod("Summary",
dimnames = list(colnames(n), c("median", "lower", "upper"))
)
HPD[, 1] <- colMedians(n, na.rm = na.rm)
HPD[, 2:3] <- apply(n, 2, function(col) {
ind_not_na <- !is.na(HPD[, 1])
HPD[ind_not_na, 2:3] <- apply(n[, ind_not_na, drop=FALSE], 2, function(col) {
if (na.rm) {
col <- na.omit(col)
# avoid coda error for no samples
Expand Down

0 comments on commit 480bf74

Please sign in to comment.