powered by
Returns a data.frame that includes sample names, metadata (if present) and value data. One advantage over as.matrix, is that the metadata are returned.
# S3 method for spectra as.data.frame( x, row.names = NULL, optional = FALSE, fix_names = "none", metadata = TRUE, ... )
data.frame with: sample_name, metadata (if any) and value.
spectra object
does nothing. Here for compatibility with S3 generics
Use make.names to normalize names? Pick one: "none" "row" "col" "both".
boolean. Include spectral metadata? Defaults to TRUE
extra parameters passed to the generic as_spectra
Jose Eduardo Meireles
library(spectrolab) spec = as_spectra(spec_matrix_example, name_idx = 1) df = as.data.frame(spec, fix_names = "none")
Run the code above in your browser using DataLab