Learn R Programming

ir (version 0.2.0)

ir_average: Averages infrared spectra within groups

Description

ir_average averages infrared spectra within a user-defined group. NA values are omitted by default.

Usage

ir_average(x, ..., na.rm = TRUE)

Arguments

x

An object of class ir.

...

Variables in x to use as groups.

na.rm

A logical value indicating if NA values should be dropped (TRUE) or not (FALSE).

Value

An object of class ir where spectra have been averaged within groups defined by ....

Examples

Run this code
# NOT RUN {
# average the sample data spectra across sample types
x <-
  ir::ir_sample_data %>%
  ir::ir_average(sample_type)
# }

Run the code above in your browser using DataLab