diff --git a/R/XcmsExperiment-functions.R b/R/XcmsExperiment-functions.R index cb6be689..b0906bb8 100644 --- a/R/XcmsExperiment-functions.R +++ b/R/XcmsExperiment-functions.R @@ -797,7 +797,7 @@ chromPeakColumns = c("rt", "mz"), BPPARAM = bpparam()) { method <- match.arg(method) - if (!chromPeakColumns %in% colnames(.chromPeaks(x))) + if (!all(chromPeakColumns %in% colnames(.chromPeaks(x)))) stop("One or more of the columns in 'chromPeakColumns' are not ", "available in the 'chromPeaks' data.") pks <- .chromPeaks(x)[, union(c("mz", "mzmin", "mzmax", "rt", diff --git a/R/XcmsExperiment.R b/R/XcmsExperiment.R index 69588eb6..487b868c 100644 --- a/R/XcmsExperiment.R +++ b/R/XcmsExperiment.R @@ -1782,7 +1782,7 @@ setMethod( if (!hasFeatures(object)) stop("No feature definitions present. Please run ", "'groupChromPeaks' first.") - if (!featureColumns %in% colnames(featureDefinitions(object))) + if (!all(featureColumns %in% colnames(featureDefinitions(object)))) stop("One or more of the requested 'featureColumns' are not ", "present in the feature definitions.") if (hasAdjustedRtime(object))