-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathir_divide.Rd
47 lines (43 loc) · 1.48 KB
/
ir_divide.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Ops.R
\name{ir_divide}
\alias{ir_divide}
\title{Divide infrared spectra or divide infrared spectra by a numeric value}
\usage{
ir_divide(x, y)
}
\arguments{
\item{x}{An object of class \code{\link[=ir_new_ir]{ir}}.}
\item{y}{An object of class \code{\link[=ir_new_ir]{ir}} or a numeic value. If \code{y}
is an object of class \code{ir}, it must have the same number of rows as
\code{x} and the same x axis values (e.g. wavenumber values) in each matching
spectrum as in \code{x}.}
}
\value{
\code{x} where for each spectrum intensity values are divided by
the respective intensity values in \code{y} (if \code{y} is an object of
class \code{ir}), or where all intensity values are divided by \code{y} if
\code{y} is a numeric value.
}
\description{
\code{ir_divide} takes two objects of class \code{ir}, \code{x} and
\code{y}, and divides their intensity values, or it takes one object of
class \code{ir}, \code{x}, and one numeric value, \code{y}, and divides
all intensity values in \code{x} by \code{y}.
}
\examples{
# division with y as ir object
x1 <-
ir::ir_divide(ir::ir_sample_data, ir::ir_sample_data)
x2 <-
ir::ir_divide(ir::ir_sample_data, ir::ir_sample_data[1, ])
# division with y being a numeric value
x3 <-
ir::ir_divide(ir::ir_sample_data, y = 20)
# division with y being a numeric vector
x4 <-
ir::ir_divide(
ir::ir_sample_data,
seq(from = 0.1, to = 2, length.out = nrow(ir::ir_sample_data))
)
}