From 255c2fd777cdf3cf76573d855fe396e2cf77b8cd Mon Sep 17 00:00:00 2001 From: Philippine Louail Date: Thu, 15 Feb 2024 13:34:47 +0100 Subject: [PATCH] small example fix --- R/Spectra.R | 9 +++++---- man/Spectra.Rd | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/R/Spectra.R b/R/Spectra.R index 2ee267c2..e6aa171c 100644 --- a/R/Spectra.R +++ b/R/Spectra.R @@ -1270,7 +1270,7 @@ NULL #' ## in `spectraData`. #' spectraVariables <- c("rtime", "precursorMz", "peaksCount") #' ranges <- c(30, 350, 200,500, 350, 600) -#' filt_spectra <- filterRanges(data, spectraVariables = spectraVariables, +#' filt_spectra <- filterRanges(sciex, spectraVariables = spectraVariables, #' ranges = ranges) #' #' ## ---- DATA MANIPULATIONS AND OTHER OPERATIONS ---- @@ -2424,10 +2424,11 @@ setMethod("filterRanges", "Spectra", if (length(spectraVariables) != length(ranges) / 2) stop("Length of 'spectraVariables' must be half the length ", "of 'ranges'") - if (is.character(spectraVariables)) + if (is.character(spectraVariables)){ if(!all(spectraVariables %in% spectraVariables(object))) - stop("'spectraVariables' need to correspond to colnames of", - "the 'spectraData' of the object") + stop("'spectraVariables' need to correspond to colnames of", + "the 'spectraData' of the object") + } query <- spectraData(object)[, spectraVariables] nc <- ncol(query) diff --git a/man/Spectra.Rd b/man/Spectra.Rd index fd8b9fcb..0a191f55 100644 --- a/man/Spectra.Rd +++ b/man/Spectra.Rd @@ -1664,7 +1664,7 @@ plotSpectra(fft_spectrum_filtered, xlim = c(264.5, 265.5), ylim = c(0, 5e6)) ## in `spectraData`. spectraVariables <- c("rtime", "precursorMz", "peaksCount") ranges <- c(30, 350, 200,500, 350, 600) -filt_spectra <- filterRanges(data, spectraVariables = spectraVariables, +filt_spectra <- filterRanges(sciex, spectraVariables = spectraVariables, ranges = ranges) ## ---- DATA MANIPULATIONS AND OTHER OPERATIONS ----