as_spectra: Convert matrix or data frame to spectra

View source: R/conversion.R

as_spectraR Documentation

Convert matrix or data frame to spectra

Description

Convert matrix or data frame to spectra

Usage

as_spectra(x, name_idx = NULL, meta_idxs = NULL)

Arguments

x

matrix or dataframe. Samples are in rows and bands in columns. Any data that are not the spectra themselves (labels or metadata) must have their column index included in 'name_idx' or 'meta_idxs'.

name_idx

column index with sample names. Defaults to NULL. If NULL or 0, rownames(x) or a sequence of integers will be assigned as names.

meta_idxs

column indices with metadata (not name and not value). Defaults to NULL

Value

spectra object

Author(s)

Jose Eduardo Meireles

Examples

library(spectrolab)
as_spectra(spec_matrix_example, name_idx = 1)

spectrolab documentation built on Feb. 16, 2023, 10:27 p.m.