Learn R Programming

ChemoSpec (version 1.60-4)

removeSample: Remove Samples or Groups from a Spectra Object

Description

Removes specified samples from a "Spectra" object.

Usage

removeSample(spectra, rem.sam)
removeGroup(spectra, rem.group)

Arguments

Value

A modified object of S3 class "Spectra".

Rdversion

1.1

Details

If rem.sam or rem.group is a character vector, the sample or group names are grepped for the corresponding values. 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. removeSample removes samples (objects) based upon the sample names. removeGroup removes entire groups based upon the group name.

References

http://academic.depauw.edu/~hanson/ChemoSpec/ChemoSpec.html

See Also

removeFreq to remove selected frequencies from a "Spectra" object.

Examples

Run this code
data(CuticleIR)
new1 <- removeSample(CuticleIR, rem.sam = 20)
# removes the 20th spectrum/sample
new2 <- removeSample(CuticleIR, rem.sam = "GE")
# removes all samples whose name contains "GE"
new3 <- removeSample(CuticleIR, rem.sam = "GE10")
# removes one spectrum/sample with this exact name.

Run the code above in your browser using DataLab