Learn R Programming

specmine (version 4.0.0)

raman_normalize_peak_features: Normalize peak feature matrix

Description

Normalizes a peak-feature matrix returned by raman_align_peaks().

Usage

raman_normalize_peak_features(features, method = "min-max")

Value

Data frame with the same structure as features, containing normalized sample-feature values.

Arguments

features

Data frame with a numeric wavenumber column and one or more numeric sample-feature columns.

method

Normalization method: "min-max" or "L2".

Details

With method = "min-max", normalization is carried out row-wise across samples. Rows containing identical values for every sample are set to zero. With method = "L2", normalization is performed column-wise for each sample. Columns with zero L2 norm are retained as zero.

Examples

Run this code
features = data.frame(
  wavenumber = c(1000, 1200, 1600),
  sample1 = c(1, 2, 3),
  sample2 = c(2, 4, 6)
)

raman_normalize_peak_features(features, method = "L2")

Run the code above in your browser using DataLab