| removeGroup {ChemoSpec} | R Documentation |
Removes specified groups or samples from a Spectra object.
removeGroup(spectra, rem.group) removeSample(spectra, rem.sam)
spectra |
An object of S3 class |
rem.group |
A character vector giving the groups to be removed. |
rem.sam |
Either an integer vector specifying the samples to be removed, or a character vector giving the sample names to be removed. |
Both functions will report if extra data elements are found. These will probably need to be edited manually. The indices reported to the console can be helpful in this regard.
If rem.sam is a character vector, the sample
names are grepped for the corresponding values. rem.group
also uses grep. Remember that the
grepping process is greedy, i.e. grepping for "XY" find not only "XY" but
also "XYZ".
Unused levels in $groups are dropped.
A modified object of S3 class Spectra.
removeGroup: Remove groups from a Spectra object
removeSample: Remove samples from a Spectra object
Bryan A. Hanson, DePauw University.
https://github.com/bryanhanson/ChemoSpec
removeFreq to remove selected frequencies.
data(metMUD1) # removeGroup sumSpectra(metMUD1) trmt <- removeGroup(metMUD1, rem.group = "Cntrl") sumSpectra(trmt) # removeSample # Removes the 20th spectrum/sample: new1 <- removeSample(metMUD1, rem.sam = 20) # Removes one spectrum/sample with this exact name: new2 <- removeSample(metMUD1, rem.sam = "metMUD1_20")