Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

use which.max to keep up with latest changes in R 3.6 #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/xsAnnotate.R
Original file line number Diff line number Diff line change
Expand Up @@ -1387,12 +1387,12 @@ setMethod("getReducedPeaklist", "xsAnnotate", function(object, method = "median"
# Select adduct that has maximum intensities
if (default.adduct.info == "maxint") {
pl.max <- apply(X=pl.tab, MARGIN=1, FUN=function(x) { sum(x, na.rm=TRUE) } )
pl.max <- which(pl.max==max(pl.max))[1]
pl.max <- as.numeric(which.max(pl.max)[[1]])
}

# Select adduct that has most peaks
if (default.adduct.info == "maxpeaks") {
pl.max <- which(plist$npeaks==max(plist$npeaks))[1]
pl.max <- which.max(pl.tab$npeaks)[[1]]
}

# Take lowest/highest values of mzmin, mzmax & rtmin, rtmax
Expand Down Expand Up @@ -1422,7 +1422,7 @@ setMethod("getReducedPeaklist", "xsAnnotate", function(object, method = "median"

# Only take the adduct line where intensities are highest
if (method == "maxint") {
pl.met <- pl.max
pl.met <- pl.tab[pl.max,]
}

# PCA of all adducts per samples
Expand Down