diff --git a/R/functions-binning.R b/R/functions-binning.R index 07ee5dfcb..d5b925a4d 100644 --- a/R/functions-binning.R +++ b/R/functions-binning.R @@ -171,7 +171,8 @@ binYonX <- function(x, y, breaks, nBins, binSize, binFromX, stop("One of 'breaks', 'nBins' or 'binSize' has to be defined!") if (!sortedX) { message("'x' is not sorted, will sort 'x' and 'y'.") - o <- order(x, method = "radix") + ## Sort method; see issue #180 for MSnbase + o <- order(x, method = options()$BioC$xcms$sortMethod) x <- x[o] y <- y[o] } diff --git a/R/init.R b/R/init.R index 6f8c45dfd..9e6529724 100644 --- a/R/init.R +++ b/R/init.R @@ -70,12 +70,17 @@ ## getEIC method getEIC.method="getEICOld" + + ## Sort method; see issue #180 for MSnbase + sortMeth <- "auto" + if (as.numeric(R.Version()$major) >= 3 & as.numeric(R.Version()$minor) >= 3) + sortMeth <- "radix" xcms.opt <- list(findPeaks.method=findPeaks.method, findPeaks.methods=findPeaks.methods, group.method=group.method, group.methods=group.methods, retcor.method=retcor.method, retcor.methods=retcor.methods, fillPeaks.method=fillPeaks.method, fillPeaks.methods=fillPeaks.methods, specDist.methods=specDist.methods, getEIC.method=getEIC.method, - useOriginalCode = FALSE) + useOriginalCode = FALSE, sortMethod = sortMeth) class(xcms.opt) <- "BioCPkg"