View source: R/colorSpec.ops.R
chop | R Documentation |
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 )
x |
a colorSpec object |
interval |
a numeric vector with length 2 giving the endpoints of the interval, in nm |
adj |
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 x
and with organization
equal to 'matrix'
.
The names of the new spectra are formed by appending ".lo" and ".hi" to the original spectrum names.
organization
,
# 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.