### subsetting [ time , spectral axis, options ]
spectralEx <- getSpectraInTimeExample()
spectraSubset <- spectralEx[ r( 1000 , 30000 ) , r(130 , 135 ) ]
spectraSubsetTime <- spectralEx[ r( 1000 , 30000 ) , ]
spectraSubsetSpectralVals <- spectralEx[ , r(130 , 135 ) ]
spectraSubsetHours <- spectralEx[ r( 1 , 3 ) , r(130 , 135 ) , timeUnit = "hours" ]
closestSpectralVals <- spectralEx[ , e( 150, 4, 300, 500 ) ] # remark only unique values
spectraSubsetLogical <- spectralEx[ getTimePoints( spectralEx ) > 300 ,
getSpectralAxis( spectralEx ) <= 500 ]
Run the code above in your browser using DataLab