-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathir_clip.Rd
49 lines (43 loc) · 1.21 KB
/
ir_clip.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ir_clip.R
\name{ir_clip}
\alias{ir_clip}
\title{Clips infrared spectra to new wavenumber ranges}
\usage{
ir_clip(x, range)
}
\arguments{
\item{x}{An object of class \code{\link[=ir_new_ir]{ir}}.}
\item{range}{A \code{data.frame} with two columns and a row for each
wavenumber range to keep. The columns are:
\describe{
\item{start}{A numeric vector with start values for wavenumber ranges.}
\item{end}{A numeric vector with end values for wavenumber ranges.}
}
If \code{range} has more than one row, multiple ranges are clipped from
\code{x} and merged together. Overlapping ranges are not allowed.}
}
\value{
An object of class \code{ir} where spectra have been clipped.
}
\description{
\code{ir_clip} clips infrared spectra to a new, specified, wavenumber range
or multiple new specified wavenumber ranges.
}
\examples{
## clipping with one range
# define clipping range
range <-
data.frame(start = 900, end = 1000)
# clip
x <-
ir::ir_sample_data \%>\%
ir::ir_clip(range = range)
## clipping with mutliple ranges
range <-
data.frame(start = c(900, 1900), end = c(1000, 2200))
# clip
x <-
ir::ir_sample_data \%>\%
ir::ir_clip(range = range)
}