chop all spectra in a colorSpec object into low and high parts at a blending interval
## S3 method for class 'colorSpec' chop( x, interval, adj=0.5 )
a colorSpec object
a numeric vector with length 2 giving the endpoints of the interval, in nm
a number in [0,1] defining weights of low and high parts over the interval
For each spectrum, the low and high parts sum to the original spectrum. The low part vanishes on the right of the interval, and the high part vanishes on the left.
chop(x) returns a colorSpec object with twice the number of spectra in
organization equal to
The names of the new spectra are formed by appending ".lo" and ".hi" to the original spectrum names.
1 2 3 4 5 6 7 8 9
# chop blue butane flame into diatomic carbon and hydrocarbon parts path = system.file( "extdata/sources/BlueFlame.txt", package="colorSpec" ) blueflame = readSpectra( path, seq(375,650,0.5) ) plot( chop( blueflame, interval=c(432,435), adj=0.8 ) ) # chop 'white' LED into blue and yellow parts path = system.file( "extdata/sources/Gepe-G-2001-LED.sp", package="colorSpec" ) LED = readSpectra( path ) plot( chop( LED, c(470,495) ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.