cut: Manipulating the wavelength range of a 'Spectra' object

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This methods allows to either select or remove a specific range of wavelengths from a Spectra object.

Usage

1
2
  ## S4 method for signature 'Spectra'
cut(x, ..., wl)

Arguments

x

an object inheriting from class Spectra

wl

a vector of the wavelengths to either select or remove from x

...

ignored

Details

The wavelengths are extracted if wl > 0, or removed if wl < 0. You can't mix negative and positive index in wl.

Value

An object of the same class as x.

Author(s)

Pierre Roudier pierre.roudier@gmail.com

See Also

[

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Loading example data
data(australia)
spectra(australia) <- sr_no ~ ... ~ 350:2500

# Extracting a specific wavelengths range
s <- cut(australia, wl = 450:550)
plot(s)

s <- cut(australia, wl = c(450:550, 1850:2050))
plot(s)

# Removing a specific wavelengths range
s <- cut(australia, wl = -1*450:550)
plot(s)

s <- cut(australia, wl = -1*c(450:550, 1850:2050))
plot(s)

inspectr documentation built on May 2, 2019, 5:45 p.m.