Learn R Programming

MLSP (version 0.1.0)

raw: Aggregate VNIR Spectra by Columns

Description

This function aggregates VNIR (Visible and Near-Infrared) spectral data by calculating the mean of every 10 columns while removing specific detector artifact regions (~1000nm and ~1800nm) and unwanted spectral bands.

Usage

raw(vnir.matrix)

Value

A data frame containing the aggregated VNIR spectra with cleaned band names. The number of columns is reduced by averaging over every 10 bands and removing artifact-prone regions.

Arguments

vnir.matrix

A numeric matrix or data frame containing VNIR spectral data. Each row corresponds to a sample, and each column corresponds to a spectral band.

Details

The function removes columns corresponding to detector artifacts: - rm1: bands 1–46 - rm2: bands 637–666 - rm3: bands 1437–1466 - rm4: bands 2127–2151 Additionally, columns 1:4, 64:66, 144:146, and 213:214 (after averaging) are removed.

Examples

Run this code
# \donttest{
  raw_spectra <- raw(vnir_matrix)
# }

Run the code above in your browser using DataLab